>but the Blender Python API will always be attached to Blender; you cannot run it headless
You can start the blender executable with a startup script parameter and no gui and you can compile blender as a python library - shared library that you import in to your cpython instance - I've used both to create a resource build pipeline although building on Windows was a huge PITA (for eg. gigs of binary dependencies you need to clone) so I just tried building as a library on linux. I developed with library on linux and just used binary on windows to run the script.
You can start the blender executable with a startup script parameter and no gui and you can compile blender as a python library - shared library that you import in to your cpython instance - I've used both to create a resource build pipeline although building on Windows was a huge PITA (for eg. gigs of binary dependencies you need to clone) so I just tried building as a library on linux. I developed with library on linux and just used binary on windows to run the script.