That example was pretty idealized, starting and ending very close to the canal. Most voyages are probably not affected quite as starkly by the canal, and I doubt the canal can or does charge ships based on their overall itinerary.
> I doubt the canal can or does charge ships based on their overall itinerary
You'd be wrong there! They actually have a rebate system[0] based on a number of factors including origin and destination. Basically, they try to make it so that its always cheaper to go through the canal, rather than sail around.
https://www.youtube.com/watch?v=0iwOZOb90fM