how to clear parent inverse without actually moving the object
You can reset the parent inverse matrix, then apply the relationship between the original matrix and the parents onto the child object. 

This script assumes you have the child selected.

import bpy
ob = bpy.context.object

# Store a copy of the objects final transformation
# so we can read from it later.
ob_matrix_orig = ob.matrix_world.copy()

# Reset parent inverse matrix.
# (relationship created when parenting)
ob.matrix_parent_inverse.identity()

# Re-apply the difference between parent/child
# (this writes directly into the loc/scale/rot) via a matrix.
ob.matrix_basis = ob.parent.matrix_world.inverted() @ ob_matrix_orig




Note, if the child has any shearing because of rotation and the parents non-uniform scaling, that will be removed, since loc/scale/rot can't represent shearing.