Gun lock? I’m pretty sure most new firearms come with an included lock either in the box or, on some pistols, as part of the pistol. Training is mostly confined to CCW applicants in some states, not long gun sales.
Maryland requires a special gun lock with each new firearm, and at least for pistols the locks included by manufacturers don't qualify. It's just an extra tax on firearms, and I'd guess less than 5% of those locks are actually used. The purpose of a self/home-defense firearm is not to store it in a manner than prevents its use.
We had to take a course when we bought our pistols years ago, no application for CCW. We bought them in a rush before some other dumb MD law came into being. I think it was the ammo fingerprinting. But we had to take the basic course.