How to get Location 3D cursor by Script
You can get the cursor location using bpy.context.scene.cursor_location

to change the cursor location you just set its values as shown here bpy.context.scene.cursor_location = (0,0,0)

In blender 2.80+, the syntax is :

bpy.context.scene.cursor.location = (0,0,0)