It is all well and good if Jim is walking in 2-D but not so clear if he is walking on a sphere [like Earth]. The shortest distance will then be calculated from the great circle that passes through both points.
If he was walking on another spherical object in a different galaxy which happened to be 5 metres in circumference, each leg of his journey would return him to his original position and his shortest distance home would be zero metres.
Jim isn't that much of an oddball anyway as everyone walks in straight lines - even if they are infinitely short.