> Also it would make little sense to have a law saying that you can't be a user of illegal drugs at the moment of purchase of a firearm, but you can start using such substances afterwards.
The law in question derives from the federal government's Constitutional authority to regulate interstate and international commerce, which is (I would guess) why the language fixates on that aspect. The federal government doesn't otherwise have the power to infringe on the Second, Fourth, and (possibly) Tenth Amendments - as would likely be necessary to federally require gun owners to submit to random drug tests over something that one's state has made legal.
Meanwhile, my state (last I checked) has laws on the books separately prohibiting intoxication (be it via cannabis, alcohol, or whatever) while in possession of a firearm; to my knowledge, most (all?) states do.
Both those cases entailed the defendants manufacturing something, which would be where the Feds would claim jurisdiction via their jurisdiction over interstate commerce. It's harder to make that argument w.r.t. something after a retail sale has already concluded (i.e. after the interstate commerce has happened). I wouldn't doubt the Feds would try to assert that literally everything that ever happens is or pertains to "interstate commerce", but that'd be sufficiently broad as to invalidate all sorts of other judicial precedents if actually held up in court.
Doesn't this mean that the prohibition of using such substances doesn't apply just to the moment of purchase, but to the whole period of time that you posses a firearm? I'm not a lawyer either and I'm not even American, but this is how I would interpret it. Also it would make little sense to have a law saying that you can't be a user of illegal drugs at the moment of purchase of a firearm, but you can start using such substances afterwards.