Hopefully the solution there is a bit more flexible and backwards compatible too.
But note that in the case you show, it doesn't hurt to call setGPSPower twice. I don't know if you saw but I made some changes to GPSService that should help out with other apps for now.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Yes - there's an issue open for this which I hope to address soon: https://github.com/espruino/Espruino/issues/1971
Hopefully the solution there is a bit more flexible and backwards compatible too.
But note that in the case you show, it doesn't hurt to call setGPSPower twice. I don't know if you saw but I made some changes to GPSService that should help out with other apps for now.