How about instead of a "mandatory" class it become something that is worth the persons time. For example you do not have to present a "certificate" to purchase a firearm, however if you do present said certificate you receive a $50 discount on the cost of the firearm, or maybe a $50 gift card, of course it could only be used on new gun sales and the $$ would have to come from somewhere, whether it be Pittman Robertson, NRA or the Manufacturer or a combination of them.
Instead of a discount they could just waive $50 in taxes off the purchase. Or, if that wouldn't work, perhaps attach some sort of "safety tax" that could be used to fund gun safety training, and waived if you've taken the class.
That way there would be no restriction on gun ownership, people would be encouraged to take a safety class, and it would be at least partially funded.
Again, it would all depend on how (and by whom) it was implemented, but it does seem like it could work.