Nicholas Silveira provides a look at using his Maya No Flip Pole Vector Tool which will automatically builds an a Pole Vector of an IK chain, that can also be switched from the main controller to world space.

This tool builds a no flip pole vector. After passing in a root joint, main controller, and pole vector the tool will allow the pole vector to follow the main controller or switch to world space

The Maya script will allow you to use the No Flip Pole Vector Tool through a user interface, or you are also able to just run it through the Maya terminal with some code. Nicholas notes that you can check out Matthew Murray’s No-flip Ik Limb Tutorial for an alternate setup of a no flip IK pole vector.

Check out the Maya No Flip Pole Vector Tool here for more information.