BUG: Allow show_versions to work for any module that raises an exception
- [ ] closes #59110 (Replace xxxx with the GitHub issue number)

The use of `import_optional_dependency` only can ignore `ImportError`, but as seen in the issue essentially any exception can be raised with an import.

Also cleans up some redundancy of optional dependencies being listed.

@mroeschke I think it may be a while until we do a 3.0 release, and with numpy 2.0 now released, we might be seeing more reports of problems with `show_versions()`, so we might need to do a 2.2.3 release with this patch to avoid lots of people reporting issues. OK we can backport this change just in case Merging, but happy to follow up if needed