Have you checked out the last one's relocate.py script?
https://github.com/niess/python-appi...ge/relocate.py
That script uses RPATHS and $ORIGIN to fix all the shared libs to be relative to the python executable. This is exactly how I make the macOS python build relocatable using otool and install_name tools of macOS to fix rpaths instead of patchelf.
So it should work with building a shared library version of python.
Might be worth a shot.