Given the purpose of the 2nd amendment is for a milita. Is the answer not to limit gun ownership to those serving in the militia. In the UK that would be the territorial army. Not sure if the US have an equivalent but basically those signing up would have regular training and would undertake public service functions and where necessary be sent abroad with regular troops to protect the USA.
I would have sympathy with some of the arguments if the text said:-
Shooting holes in bits of paper, being necessary to the security of a free State...... or
Culling wild animals, being necessary to the security of a free State..... or
Defending personal property, being necessary to the security of a free State....
Kind of been done before and hasn't ended well.
Depending on the presidential election outcome, can kinda see it happening again.