Help using CAPI to do what the pythonXY._pth file does

I have looked and found that there is docs for the PyConfig structure, however I noticed a few problems:

  • It likes to blindly create new instances of it if I was to call Py_Initialize (or if a function like say Py_BytesMain or Py_Main calls PyConfig_InitPythonConfig).

My issue is that I would like to have code that replaces the pythonXY._pth file within my embedding application to be as close to single file as possible. I already created a special build of pythonXY.dll that adds in all of the official c extensions that can be found in the official embedded zip files together into that single dll file without issues. With this I can shave the embedded interpreter files from 4 files to 3 files. And then for the other 2 I could look into a way to patch zipimport to allow using of the zip file from the win32 resource section, and I would have to figure out a way to stub out on the exe so it can find, and load the python core dll from the resource section as well and I would truly make it a single file interpreter.