This was a really great write up of this process.
At the end, he mentions taking InitializeProcThreadAttributeList et al from Wine. The real issue though is these are just populating a structure that is consumed by CreateProcess, and XP has no idea how to interpret it, so all of these settings get silently dropped. Whether that’s fatal depends a lot on context - if Python isn’t creating a subprocess, this code may never even run. If it does, it might be necessary to implement CreateProcess, and patch the STARTUPINFO structure to hide the new values from the OS.
Still, I’ve had a lot of success with the same general approach. Particularly for code which is originally old but has been updated for newer systems, the basic design of the code doesn’t usually depend on newer functionality, so stubbing things out works shockingly well.