pyenv has already solved a lot of the things the install_python.sh script tries to take care of, so perhaps it is worth trying to use the python-build plugin to manage the build. This would make it easier for people to port the example here elsewhere and it also support configure and make options.