Can the wp_filter object hold multiple values with the same key

Firstly, keep in mind that the structure of $wp_filter was changed in WordPress 4.7: https://make.wordpress.org/core/2016/09/08/wp_hook-next-generation-actions-and-filters/

As for your questions:

Is this possible?

Yes.

Under what circumstances would this occur?

If multiple functions have been hooked to the same action/filter, eg:

add_action( 'save_post', 'do_a_thing' );
add_action( 'save_post', 'do_another_thing' );

In that case $wp_filter['save_post'] will have multiple values.


To address your edit:

is there ever a scenario when the same $key value could be encountered twice? I suspect that

$comment_filters[$key][] = var_export( $val, TRUE ); 

could be changed to

$comment_filters[$key] = var_export( $val, TRUE );

No, it’s not possible for the same key to be encountered twice. PHP arrays cannot have the same key more than once.

Your amended code is correct. In fact, without that change implode( "\n\n", $arr_vals ) will probably not produce the expected result.