Please move this all new code from pyi_launch.c to pyi_utils.c and:
- make this functions static - meaning only internal usage
- rename them from CamelCase to  _camel_case.  The leading '_' is meant for functions that should not be visible outside a .c file.