There is an affirmative defense called “necessity.” It requires YOU to prove that there was literally NOTHING else you could have done; such as getting a ride with someone else or leaving earlier so you hadn’t been drinking etc., so you can see that it is quite a hill you’ll need to climb in order to get the court to give the instruction.