So something like gun liability insurance. With every AR-15 is the risk of it being used to commit a mass murder. Paired to that weapon is a human being who can be placed on a risk scale based on certain factors deemed more significant in predicting risk liability with regards to these things. Based on that a risk pool and associated premiums can be drawn up.
If you are 18, maybe it would cost you $12,000 per month (example) to have gun liability insurance related to a AR-15. That alone would deter a lot of people. Make it mandatory to have gun insurance for every weapon you own. Offer discounts for gun safe purchases, or storing it in an armory, or psych evals, or whatever.
Then when these events happen, insurance companies can then pay out to victims, municipalities impacted by gun violence.
This country has decided it loves gun money. Why not give Geico and The Hartford and others a piece of the action?