This assumes you provide evidence - as required - to raise the defense and that in doing so you can provide reasonable doubt for the prosecution to have to overcome. The burden is on the defendant, not the prosecution, with a "defense to prosecution."
The burden is squarely on the prosecution with an "exception."
Or, try it this way:
With a defense, the prosecution does not have to even address the possibility of a defense to charge you and start a trial and you don't get to present it until you get your first response, pleading, etc. Then it's up to you to provide enough proof to build reasonableness about the defense for the jury to accept it and up to the prosecutor to attack that proof beyond a reasonable doubt for the jury to disregard it. A jury will decide two things: is there reasonable doubt to the offense and if not, is there reasonable doubt to the defense that applies to the offense committed?
With an exception, the prosecution must address any exceptions and prove they don't apply to be able to bring a charge and start a trial. You never have to file a response, pleading, etc. because no cause of action exists.
Today, even though the law says "does not apply," it does, in fact, apply until you raise one of the "does not apply" items as a defense if you are arrested, charged and tried.
What it should be worded to do is bar arrest (which requires an affidavit of probable cause, remember) and prosecution unless the arresting officer/prosecutor can negate any/all applicable exceptions.
This is the forum for topics directly related to desired changes in the upcoming legislative session.