my opinion on this has always been strict licensing and testing. Cars kill people, so not only do you have to take a gauntlet of tests and applications to apply for the right to operate one, but as you get older you have to periodically come back and get retested to make sure you haven't lost your ability to stay safe while driving.
I don't see how guns should be different. Take all appropriate tests, get all the appropriate screening, attain a license, and periodically renew your license so people are sure you haven't gone crazy in the last few years