We can use the equation
$$F = q V_e + (P_e-P_a) A_e$$
Where $P_e$ is the exit plane pressure, $P_a$ is ambient pressure, and $A_e$ is the exit plane area. $qV_e$ without the correction term gives the thrust when the exit plane pressure matches ambient. Here $q$ is mass flow and $V_e$ is exit velocity.
For a nozzle optimized for sea level, $P_e$ = $P_a$ so there is no exit plane pressure effect thrust loss at liftoff.
Once the vehicle reaches vacuum, the term in parentheses would be equal to $P_e$. Per the equation you can see that this gives additional thrust equal to the product of $P_e$ $A_e$. However, this exhaust would be severely underexpanded and would experience losses due to a pattern of expansion waves at the nozzle exit.
A picture from here
Underexpansion is inevitable since an infinitely long De Laval nozzle would be required to get the exit plane pressure to zero. (This means that your "fixed nozzle designed for optimal in-vacuum efficiency" is always a compromise - it gets cut off due to weight, packaging considerations, etc.) Underexpansion is also more desirable than overexpansion which can result in flow separation and severe shock losses, hence the use of dual-bell nozzles and other schemes to try to match the exit plane and ambient pressures better. If these fancy schemes are not practical, some compromise design exit plane pressure is used.
The linked presentation does a great job of explaining all this with real world examples and mitigation strategies.