Once I rotate the calf so that it bends correctly, shown left with IK disabled, the IK bends the right way, shown right with IK enabled.
We could change that in the rest pose, potentially, by moving the knee forward, but that’s not always a good idea. We could use bone constraints to create the pre-IK bend if we wanted instead of manually posing the bone-- constraints on an IK chain bone will always be evaluated before the IK.