As teenage boys in Hebrew school, we always tried to figure out ways in which violating the commandment against adultery could save a life.
https://www.sefaria.org/Sanhedrin.75a.2?lang=bi&with=all&lan...
definitely prohibited
EDIT: actually this gemara is an example of saving ones own life, so maybe not