This problem is inherently American - it's not that other countries have access to some secret tech that's keeping them gun-violence-free. Saying "let's not make this political" about an entirely political issue is laughable. So is "let's fix gun violence with ML".
To actually answer the question with tech solutions:
- accurate fact-based media with no spin
- accessible education
- opportunities for people to be exposed to cultures, lifestyles and mentalities different from their own
Educated, informed and open-minded people are less likely to shoot up a school, or to buy into other people's "right" to do so.