If mass shooters are nearly always suicidal, which appears to be the case, then the approach to dealing with them must logically follow our proven approach to suicide bombers. If the perp is prepared and ready to die, deterrence doesn’t work.
That leaves prevention. Keeping them away from large, congested groups of people. The widely disliked TSA has kept bombers off planes, and is therefore an unpopular success story. Similar screening can work for schools, churches, theaters, athletic events and concerts - places where masses gather. Expect these screens to be even more unpopular than TSA.
The alternative is warehousing large numbers of mentally disturbed individuals, most of whom would never become mass murderers. Doing so has both economic and human liberty implications which would offend many of us.
My conclusion: there are no easy answers.