BPY in Game Engine Workaround?
If you use the BPY module, you can still run it as non-runtime code.
This is perhaps what is wanted in your case (you are not forced to create a game with the BGE.
However, in most cases, the authors want to create a game. Non-runtime code will prevent him from creating one.
Using BPY in a game is a typical mistake as you yourself can find in research regarding Blender scripts. It is usually plain copied from there as it is not clear to them that Blender and BGE are two separate rendering engines. This image exists. as this topic comes up from time to time. I hope it is a funny way to help remind to stay clear and avoid BPY for games.