What different ways can a plugin add a filter to a WordPress site?

I’ve grepped through the plugin’s entire codebase for
<plugin_name>-output-block” and nothing.

(Revised answer) Actually, you could just deactivate all other plugins and/or switch to a default (and unmodified) theme like the Twenty Twenty theme to see whether the issue is caused by another plugin or the active theme. But even so, I hope the following helps.

is there another way that the filter could be being added? A mechanism other than add_filter()?

Basically, that’s the only proper way of registering a callback for a certain filter hook.

However, the callback can also be registered by calling add_action() instead of add_filter() (add_action() is just a wrapper for add_filter()), so try searching for that in the active theme and your plugin if necessary. For example, using regular expression (RegEx), try searching for add_(filter|action).+output\-block in the theme/plugin files (PHP files).

And although unlikely, you can also try searching in the theme for $wp_filter (which points to $GLOBALS['wp_filter']) in case it’s accessed directly to register the filter callback…

Quick & Easy (but tricky) way without manually searching in the theme/plugin files: Use Query Monitor (QM) with do_action()

(Well, you’d still need to search, but it would be much easier.)

I’m in no way affiliated with QM, neither the plugin nor its author(s), but QM can help you find the code which hooks to the <plugin_name>-output-block hook.

  1. In your plugin, temporarily use do_action() and not apply_filters():

    $output = do_action('<plugin_name>-output-block', $output, $my_args);       // use this
    //$output = apply_filters('<plugin_name>-output-block', $output, $my_args); // not this
    

    But since you said, “if I comment out that line, the output definitely breaks“, then you may have to uncomment the second line above. But then, doing so means that all the hook callbacks will be called at least twice, so try first with the second line commented out.

  2. Then just click on the “Hooks & Actions” item in the QM admin toolbar menu and select the “block” hook from the drop-down menu in the left side:

    enter image description here