I used to think this as well, and when you say "prevent" you mean of course significantly reduce the probability. In fact, Lucrum had me totally convinced it was true that we could never do much about gun violence and mass shootings because there were just too many guns already and the Second amendment constrained us. But I have learned much more, and now I am convinced I was wrong. Logically the number of guns is a factor, but the types of guns and their distribution should be a far more important factor. The usual arguments are incorrectly phrased. The arguments should be probability based and take into account both the types of guns and their distribution among owners. Arguing that doing this or that will stop gun crimes is is a losing argument. The arguments must relate to probability. And of course any measure in the U.S. will be Second Amendment constrained. But this is, in reality, not a significant restraint. It has been falsely made to appear so.
For example, per capita gun ownership in Canada is estimated to be about half, or a little less, what it is in the U.S. It is easy therefore to blame the higher rate of gun crime in the U.S. on the much higher per capita rate of gun ownership. However this argument breaks down as soon as distribution is taken into account. And if the difference in gun laws in the two countries is ignored, than the arguments based on per capita gun ownership are no longer persuasive in the least. The gun laws are very different in Canada, as is the rate of gun crimes and mass shootings.. Just the number of guns divided by the population is far too crude a measure to allow any conclusion, but it does provide an attractive, but defective, argument for the gun lobby.