I have a hidden momentary switch that needs to be held down to start, an alarm and a steering wheel club. I also try to be careful where I park, and whenever possible like at a restaurant I get seated where I can see whatever I am driving thru the window. At night it's locked in my yard behind steel gates.
Haven't thought too much about carjacking but let's say I am carjacked after I've started the engine, I could shut it off and jump out, the carjacker would be stopped/delayed by the hidden switch, and mine is hidden pretty good, and awkward to reach. Another way to avoid a carjacking, the kind where they hold you up for your keys, is to keep the steering wheel club key on your second keychain, then hand over the keys and boogie. By the time they realize the club key is not there you'll be gone.
The firearm idea is good but it comes with other problems, like what do you do with it when you are parked, how can you get to it fast enough etc. You almost need to carry concealed all the time and that's not for everyone.