No. A pilot's job is to keep control of his airplane. For the pilot to intervene in the cabin would be to risk losing control of the aircraft.
As long as the pilot remains in the cockpit, the only possible direction of attack is through the door, and identification of friend/foe is easy. Essentially, the pilot just has to make a center-of-mass shot at any unauthorized person forcing their way into the cockpit. Not exactly a task requiring a high degree of marksmanship or expert judgement. Nearly any situation involving intervention in the cabin will require far greater skills in marksmanship and friend/foe identification. Given the possibility of a hijacker posing as a "friend" who assists in subduing other (decoy) hijackers, pilot intervention in cabin disturbances is a recipe for disaster.
Picture in your mind the cockpit of a commercial airliner and the total amount of room once you are through the door. Then ask your self where to put the bodies as the each is shot without losing the advantage of the "choke point". How many downed hijackers OR passengers before the flight crew has no room to maneuver at all? I am not against the pilots being armed but dammit it is not an end unto itself.