I would encourage you with a SCOTUS decision from 2016 Caetano v. Massachusetts
The case involved a woman in Massachusetts who was convicted for using a stun gun to defend herself against an abusive boyfriend. Stun guns were illegal in MA at that time. She appealed her conviction all the way up to the Mass Supreme Judicial Court who at the end upheld her conviction. SCOTUS reviewed the case and vacated the Mass SJC decision and remanded the case back for review in the the light of Heller v. DC. SCOTUS essentially said (see the first paragraph in the linked document) that the 2A applies to "all instruments that constitute bearable arms".
Happy ending: Stun guns are now legal in Mass to carry with a pistol permit AND (wierd but true) they must be generally shaped like a handgun. No "stun pens" or stun guns that look like cell phones BUT I suppose you could have one that looks like a Star Trek phaser
...
I reckon you could defend yourself with an airgun and they are protected by the 2A... Regards