Opinions appear to vary on this but it seems like sailing into the scenery should be potentially costly.
Speed dropping to zero after hitting shallows/shoreline could initiate a five-second countdown timer. If the captain has not gotten clear within that period a battle window opens where three things happen.
1) You've run around and a damage mechanic goes to work on the hull.
2) A button appears to refloat the ship.
The amount of damage done, and whether you get refloated would be probability calculations based on whether the wind is onshore or off, the amount of cargo in the hold, and timing intervals.
3) The sharks are invited. Sooner or latter a hostile AI shows up. And crossed swords appear in open world inviting other players to attack / defend while you are trying to refloat.