When writing code which loads dynamic libraries, it is often very useful to be able to query which shared libraries are already in use by the current process. There are a few well-known tricks to do this, but they all end up being platform dependent.
For example, on Linux, you can use dl_iterate_phdr, and it seems that quite a bit of Python code does. This won’t work on macOS or Windows, which provide other functions for this same functionality.
I do think a lot of people who need this functionality may already have ad-hoc implementations themselves, so are unlikely to switch to a library by some random developer (e.g., me), but would likely use a version in a standard library. We will see, I suppose!
I’m assuming that if it goes into the stdlib, you’d be creating the PR to add it - so either way, it would be the same code written by the same random developer
But I get your point. Being in the stdlib adds a level of credibility and convenience. It’s possible that if you just submit the function as a PR, one of the core devs would be happy to approve and merge it (I won’t do so myself, simply because I don’t have enough involvement with ctypes to feel comfortable merging changes to it). Being a popular module on PyPI isn’t necessary, it’s just helpful (if the proposal needs supporting evidence).