Don’t confuse yourself by introducing the term “retreat” to the situation you describe.
The decision to retreat occurs during conduct combat phase (Step 6 of the General Combat Sequence).
Your scenario is at the beginning of the Combat Move Phase - and the “Sea Units Starting in Hostile Sea Zones”-rules (rulebook page 12) apply. So this is about combat movement, not about retreating.
And in this phase sea units can move their full range.
The enemy destroyer of course has no effect on the submarine’s movement here - as the submarine is already there - and does not enter or move through a hostile seazone containing an enemy destroyer.