Use Python to Teleport Mouse in Blender Window (like when scaling)
Your operator should include the following in the bl_options: 


GRAB_CURSOR to allow it to grab the mouse focus and 
BLOCKING to prevent anything else from using the cursor


Like this:

bl_options = {'GRAB_CURSOR', 'BLOCKING'}


More info in the API documents.

As an example, you may see this in action in blender/2.79/scripts/addons/mesh_extra_tools.py