> especially if you have super strict civilian firearm laws like Costa Rica that make putting together defensive militias much, much harder.
Not refuting the larger point, but this part sounds questionable. For a country, rifles are easy to provision: just buy enough and keep them in well-guarded armories in strategic locations. Trained soldiers are much harder to come by.
South Korea has relatively strict gun laws and very few people own one at home. But almost every male goes through two years of military service. In case of a foreign invasion, it won't take 24 hours to summon millions of civilians, just throw each one a rifle, and there's your army.