If loading the initialisation of ParamInfo was successful, some of the core API modules are working correctly.
If then loading a batch of modules causes a server error, the paraminfo class could retry the batch by loading paraminfo for one module at a time, and report which module fails.
Another option is to avoid loading non-core modules, or avoid loading all modules to determine prefixes.
This should make pywikibot more resilient for when defective modules deployed to a wiki, and result in quicker & better errors reported to WMF ops / release managers.
(Currently WMF test and beta wikis have such a defective module : T100775 , so fixing this quickly may be necessary in case Wikimedia dont revert / fix the problem)