That is an open-ended question. It is a fairly complicated task so it isn't much different than asking "how to program".
One suggestion would be to use a language designed to be embedded, like lua. There might be some similar wrappers around Python.
A more straightforward way is to just build Python from scratch, with the "PREFIX" value being a path inside your project. You are essentially creaing your own "/usr" directory. You may need some dependencies. I think I needed OpenSSL for Python, but then it turned out that I needed OpenSSL for other things too.
Once your tool is built, you can put your custom "/usr/bin" directory at the front of your path and test it. You may need other environment variables set as well, depending on the project. Once you are certain that works, you can bundle your custom /usr directory inside your app. I recommend using the path "Content/Helpers" for executables. You have to be careful about signatures. If you put executable in the wrong directories, they might not be signed correctly and then they will have problems at runtime.
Once it is all bundled up, your app can set any environment variables it needs and then execute the bundled tool with the desired arguments. Since you don't have a terminal, you will have to be clever about standard input, output, and error. Personally, I use real old-school select() statements for these. I've tried all the fancier options but I find the basic approach to be the easiest one to conceptualize. There are fewer things to ***** up.
See what I mean about asking "how to program"?