Why not use help('modules')
Yes, help('modules')
works great for interactive mode.
The examples in the post show how to use the output programmatically. Programatic access may find uses in plugin creation or dynamic importing.
For example:
https://botoform.readthedocs.io/en/latest/reference/plugins/