they do it pretty well in other countries by lessening everyone's access to guns.
but maybe in the US we could do it differently. mandate that every gun is insured for damages caused. call them militias. private entities that oversaw all purchases and tracked them. the govt wouldn't know where the guns were, only that the militia was responsible for it. if they were needed to end a federal dictatorship, the legal responsibility would go out the window anyway.