Well just think about it, defendant bears the burden (preponderance of the evidence) at a pretrial evidentiary hearing. Elements:
1) no unlawful activity
2) in a place you have a right to be
3) reasonably believe necessary to prevent death or great bodily harm to self or another or to prevent commission of forcible felony.
Prove that up and no jury, no trial, you are immune. That's it. And there are open questions, unresolved between courts of different jurisdiction about how this applies to various situations...