The Second Amendment does indeed protect the right of individuals to keep and bear arms, but the government can create restrictions provided they pass the
Strict Scrutiny test.
In other words, any restriction on weapons must fulfill these requirements.
First, it must be justified by a compelling governmental interest. While the Courts have never brightly defined how to determine if an interest is compelling, the concept generally refers to something necessary or crucial, as opposed to something merely preferred. Examples include national security, preserving the lives of multiple individuals, and not violating explicit constitutional protections.
Second, the law or policy must be narrowly tailored to achieve that goal or interest. If the government action encompasses too much (over-inclusive) or fails to address essential aspects of the compelling interest (under-inclusive), then the rule is not considered narrowly tailored.
Finally, the law or policy must be the least restrictive means for achieving that interest. More accurately, there cannot be a less restrictive way to effectively achieve the compelling government interest, but the test will not fail just because there is another method that is equally the least restrictive. Some legal scholars consider this 'least restrictive means' requirement part of being narrowly tailored, though the Court generally evaluates it as a separate prong.
That would be my ideal ruling on this case, which would imply that a blanket ban on handguns is unconstitutional, but less restrictive means to deal with safety and crime issues might be acceptable.
But yeah, that would assume we had a government and a SCOTUS capable of this line of thought, and not hamstrung by corruption and bad ideology.