At that point the shared libraries are useless, they don't provide security (update in one place and have all aps using it patched), doesn't save RAM (each app loads their own version of library, instead of multiple apps sharing the same code), and you get worse performance (there's overhead for using shared libraries).
What lsaferite suggested makes sense, if the library is used only by given app, why not compile it statically? You have everything in a single file, and at least you're not losing performance by using shared objects.
What about OpenSSH does that mean any program that uses SSH needs its own copy and then we have 12 different versions of SSH?
Its not easy but I am sure someone is smart enough to figure this stuff out. NixOS and Gobo Linux have tried.
These are packages that other packages can refer to rather than massively duplicating the content within themselves.
These frameworks will in turn be versioned, so that if package X wants framework Z, while Y wants Z+1 they can both be happy without descending into dependency hell.
Note that Gobolinux gets around this to a degree by using age old soname and symlinks. This in that ld and similar is pointed at a directory containing symlinks.
libxyz.so.1 will be pointing to whatever is the active version of libxyz, while something like libxyz.so.1.1 will be pointing to that specific lib version.
Disabling a specific lib version is done by removing the relevant symlinks.
Gobolinux provides tools for doing this, but they are basically shell scripts. And so in a pinch someone can do all that manually.