Exclude taxonomy term from all loops, but having it on widget

Looks like you’ve excluded a taxonomy term, not the whole taxonomy. Is that what you intended?

But on to the answer…

Right before your query in the widget add:

remove_action( 'pre_get_posts', 'exclude_category_posts' );

And then you probably want to put it back again after that query by repeating:

add_action( 'pre_get_posts', 'exclude_category_posts' );

That is a bit of a “dirty” method and assumes that this is your site and your widget. You may need something more complex if circumstances are different from that.