consolidate handling for well known objects across refs and analysis (#69111)
### What?
We have a set of known functions with special handling to fix problematic or nonstandard packages. This PR ensures the logic for mapping string package names to these well known functions is in one place and one place only.
### Why?
We had two slowly diverging implementations.
### How?
Utility function. I opted not to implement TryInto as we do not have a surjective mapping into the codomain.