Conduct by a person (A) which would otherwise be an offence under section 25 or 26 against another person (B) is not an offence under that section if—
Subsection (1) does not apply if at the time referred to in subsection (1)(c) sexual intercourse between A and B would have been unlawful.
In proceedings for an offence under section 25 or 26 it is for the defendant to prove the matters mentioned in subsection (1)(a) to (c).