I wonder if a bbgun would be good protection.
Maybe from squirrel attacks.

squirrels are dangerous
Well, there are some pretty impressive air guns on the market, and if someone came into my house and that was all I had, I would certainly try for a head shot, but after that shot, you better be ready to follow-up with something else.
There are also interesting stun guns for use at intermediate range which would definitely incapacitate at attacker, and you would not need to get within arm reach to use them, if you are leery of guns.