No one with even an ounce of sanity and decency would claim that, for instance, imposing harsher sentences on crimes committed with guns violates the 2nd Amendment - and the courts have, as far as I know, largely upheld such laws. The reason is that in such cases the gun itself is not the basis of the indictment, but the way in which the weapon is abused to harm or endanger others. So here is an elegant solution to potential court challenges against any gun control measures that may be proposed: Separate the gun from the crime in the same way. It is not possession of so-and-so banned article that is prosecuted, but the failure to undertake the extraordinary obligations that such possession entails - pretty much exactly the same thing as punishing recklessness or criminality. This is how strict control of fully automatic weapons has remained in effect since the days of Al Capone, and it can and should be far more broadly expanded.
An analogy would be the fact that you have a right to freedom of speech and movement, but failing to answer a jury duty summons and appear if required is not an option. In other words, the very fact of being a citizen entails obligations that attend our most fundamental rights, and if you ignore those obligations - e.g., ignore a jury summons - you may face criminal charges. This was what the Founders were referring to when they spoke of a "well-regulated militia" - it's the same principle as jury duty, only rather than being selected by lottery, you volunteer for the obligations of firearm possession by choosing to be a gun owner.
So to claim that such regulations would be a "violation" of the right to bear arms is nonsensical and boils down to anarchistic ideologies that deny that rights and responsibilities are inseparable. So-called "freedom" in a libertarian state does not last long: The only people who can win a civilian arms race are inevitably the rich and powerful, and what good would the armament of the average person be then when their lives are tyrannized by unelected, unaccountable masters hiding in impregnable private fortresses behind a six-deep cadre of blood-soaked mercenaries? Whither fantasies of popular revolution when everyone around you depends on obedience to those masters to have employment and feed their families?
Rights-sans-obligations is nothing more than dissolution of human civilization in favor of a zero-sum power struggle, and we already know the results of that because that's been the story throughout most of human history: A handful of people with everything, but who even then live in constant fear of each other's murderous machinations, and surrounded by innumerable people who are nothing more than slaves and illiterate peasants dying by age 27. The only contenders for power in such a situation are not activated by political ideals, but are simply other masters trying to seize the throne; bandits in the countryside surviving by preying on the defenseless (Robin Hoods were exceedingly rare); and priests trying to maintain their cultural prerogatives by promoting fear, superstition, ignorance, and bigotry. There is no liberty anywhere in that milieu, for anyone, ever: Just unrelenting degradation.
The alternative, which relatively few societies have ever understood enough to pursue, is one where rights and obligations are not only inseparable, but appreciated as being basically the same thing. Societies that have understood this to some extent will try to maintain the ability of individuals to seek their own ideal balance on the spectrum of rights and obligations, and that is what is meant by freedom - not an absence of obligation, but the liberty to choose what set of rights-obligations suits your personality and goals in life. And that is the spirit of the 2nd Amendment, and as far as I'm concerned, clearly articulated in its language. You cannot assert a right without acknowledging the rights of others, and that's all a civic obligation is - admitting that other people have rights by you.
So that's how to pass gun laws that will have the best architecture to withstand court challenges: Make the actual criminal aspect the actions or dereliction of actions surrounding the gun, not the gun itself. As I noted, our treatment of machine guns has already demonstrated the way to do this - you can get a machine gun if you're determined, but there are a hell of a lot of regulatory requirements involved. This can extend very far without becoming legally problematic: In the same way that you can regulate how anything is designed and built for public safety reasons, you can regulate how firearms are designed and manufactured to optimize them for legitimate purposes while limiting their capacity to enable crime. You can also regulate the business practices surrounding them to mitigate or entirely remove the commercial incentive to promote crime and violence.
There are so many great possibilities in how to approach this, and it will be important in the near future to make sure that all options are brought to the table and given due consideration by our elected leaders - we should not just have some boilerplate legislation passed that does nothing to address the fundamental aspects of the problems we face with the status quo in gun policy, and we should also be wary of attempts to design such legislation to fail in the courts. It's our job as thinkers to come up with ideas from outside the box and bring them to the attention of the mediocre minds who live in the Beltway bubble so they're not just making symbolic gestures at the expense of truly addressing the problem.
To the extent that people still want the 2nd Amendment to apply, we must demand that they acknowledge the whole Amendment and not just the part they find convenient. Any approach to guns that makes a "well-regulated militia" virtually impossible was clearly not intended, nor was any approach that directly undermines the "security of a free state" the 2nd cites as the reason for the right to bear arms. I know that conservatives by and large aren't comfortable with thinking and having new ideas, but they're going to have to if they want to meaningfully participate in this discussion because the policies they've created have not worked and in fact have created a circumstance that flies in the face of everything intended by the 2nd Amendment they claim to support.
Their old playbook of just denying reality and doubling down on failure is not going to play anymore - if they are serious about this issue, they need to come up with proposals that are rational and responsible, because we're just not interested in hearing them say we have to accept murder sprees as the "price of freedom." That doesn't look much like freedom to me or most people, and if they can't offer realistic and effective alternatives to rigorous gun control, they will simply be ignored.