The 2nd Amendment specifies that a well regulated militia is necessary for a free state, and that the right to keep and bear arms cannot be abridged by the Federal government.
Nothing in that amendment specifically mentions the purpose of preventing totalitarian government. That's a modern interpretation, albeit one currently upheld by the Supreme Court.
You have to take into account the context. It was written and ratified by people who'd just staged a revolution against what they described as a "tyrannical" regime, often using their own personal weapons.
To note that the Constitution doesn't mention "totalitarianism" is to note that it doesn't contain an anachronism. It's a modern coinage that's not to far in meaning from "tyranny."
Exactly. If America has learned anything from the past half century of foreign military adventures, it should be that a big modern Army can't easily defeat a motivated insurgency that has the support and sympathy in the local population.
The 2nd Amendment may have a lot of costs, but the private gun ownership it provides for would definitely make it much more difficult for a domestic totalitarian regime to establish itself in the US.
I'm also pretty sure that Iraqi civilians didn't have much access to small arms prior to the destabilization of the country. Didn't slow down the insurgency any.
An insurgency has a lot of freedom in choosing its targets. If they don't have the weapons to directly attack armor or air power, they can avoid them. And with armor, there are other options, such as IEDs.
Also, I'd bet that an American insurgency against a totalitarian American government would get outside arms and support, as well as sympathy, support, and defections from actual US Army units. I don't think the US military would be able to maintain the same level of cohesion it has during foreign wars in a civil war.
A totalitarian regime would probably repeal the 2nd amendment as one of it's first acts, the the existing stock of small arms and ammunition would be enough for an insurgency or rebellion to start. I'd be much harder for a disarmed population to begin resistance.
Think about any standoff between protesters and police or national guard in the us. Lefty students or unionists or whatever get shot or peppersprayed by cops or national guardsmen with a family to feed and a career defined by obeying the rules - that equation will not change with scale.