The 2nd amendment actually says nothing about “guns” it talks about “arms”. I’m not positive what the original writers thought arms included, but it almost certainly didn’t include stun guns (or nuclear weapons). The latter apparently it is OK to ban from personal use, the former apparently not.
In D.C. v Heller, the Supreme Court held:
“Like most rights, the Second Amendment right is not unlimited. It is not a right to keep and carry any weapon whatsoever in any manner whatsoever and for whatever purpose … Miller’s holding that the sorts of weapons protected are those ‘in common use at the time’ finds support in the historical tradition of prohibiting the carrying of dangerous and unusual weapons.”
So the Constitutional question was whether or not stun guns are in common use ‘at the time’. If ‘at the time’ means when the 2nd Amendment was written, the the answer is depends on whether or not it’s considered similar enough to guns that were available.
If it means presently, there is still a question about whether they are in common use. I don’t know the answer to that though it seems hardly possible they are commonly in (legal) use if they are outlawed – again unless they are similar enough to guns to be covered by their use.