Child Of's set inverse without using bpy.ops
Try:

const.inverse_matrix = target.matrix_world.inverted()   
obj.update_tag({'OBJECT'})
bpy.context.scene.update()


This does not show up immediatly. You have to update the view / tag the region for redraw.