IK constraint causes crazy global rotation
Here is what I would say:


Select your armature, go in Properties > Data > Display > B-Bone, so that you can easily see your bones. Select all the bones in Edit mode and ctrl alt S to thin them.
In Edit mode, select the foot_IK.L and drag it back behind the foot so that you can see it. Also, rotate it 180° on the X axis so that its head is in the good position.
Now, the parentage is bad, neither the foot.L nor the foot_IK.L should be parented to the shin, and the foot.L should be parented to the foot_IK.L, so, in Edit mode: Select the foot_IK.L and alt P > Clear Parent and select the foot.L then select the foot_IK.L and ctrl P > Make Parent > Keep Offset.


It should work correctly.