Replace "except:" with "except Exception:"

Fixes #5669

Most changed, but not all; a few looked like they belonged being bare.
In particular, mpmath is not affected, nor tests.