The situation is completely analogous with automobiles. The government ensures people granted driver's licenses are cognitively capable of safe operation of their vehicle. More importantly, the government tracks vehicles to ensure just compensation for parties injured by the operation of a motor vehicle.
The only reason a similar institution has not been built for firearms is a) gun culture represents a small and decreasing minority of Americans and b) legislative capture by the munitions industry.