MPH Misses the Point with Raiders of the Lost Ark.
"Our hero swims to a German u-boat that is about to dive, where he grabs on to the periscope and should drown."
It descended to periscope depth, as German subs routinely did when patrolling.
"Or maybe get hypothermia..."
'Maybe' is not good enough. How long was the trip? Benefit of the doubt.
"or be discovered by the patrols that would be on deck whenever the sub was above water."
One of the things that makes Raiders brilliant is that it does not insult the intelligence of the readers. The primary purpose of the first half of any story is to set the stage, and the character's capabilities, so that when the action speeds up, we do not need to be shown every single step. We do not need to be beaten over the head about how UNCANNILY resourceful Jones is. Once we are shown, it is taken for granted thereafter.
The audience: "Indiana Jones finds scarier things than that in his breakfast cereal! ...sealed submarine indeed ... HAH!"
1) An average human being swims at roughly 3-5 miles an hour. It would be impossible to swim after a U-boat going any faster than this and "catch it."
2) Even if a person could catch the U-boat, they would have extreme difficulty in holding onto an external periscope for HOURS without suffering positional injury or hypothermia (the Mediterranean Sea is warm; but not warm enough to be in it for hours without the proper clothing)
3) Even if the person avoided positional injury and hypothermia somehow, they would still face hours without food or water. Since human beings can't drink saltwater without becoming extremely dehydrated or ill, they would have a difficult time holding onto a U-boat.
4) Assuming that the U-boat didn't stop for any reason on its way to the island, Indiana Jones would have been quickly discovered as he would have been spotted by lookouts on shore waiting for the submarine. Or when he was unable to lift himself from the water after having spent hours in it.
Sorry, but nearly thirty years after the film was released, the improbability factor of Indiana Jones holding onto the sub, remains extremely high