Glocks have matching serial numbers on the plate, on the slide, and on the barrel. Getting the ones off the hardened steel is very hard to do, and most idiots trying to remove the one from the barrel are going to screw up the action.
Also just scratching the surface smooth is not enough, and most people screw that up. The stamping leaves strain marks in the metal under the surface, and these can be recovered from a completely smoothed surface.
Not arguing with the general point, just to clarify: neither slides nor barrels are regulated and both are not considered as guns (unlike frames). And on top of this barrels are consumables. I think stronger point would be that there is a hidden plates in plastic frames somewhere (i knew that there is one for scanning purposes, but the commenter bellow mentioned that they are serialized as well).
True, glocks are an exception bc the frames are plastic so they can't serialize them easily other ways. I seen other plastic guns (like hipoints and polymer80s) do the same. There's safeguards against this though, I know there's a place you can cut on a hipoint to find a hidden serial even if they remove the plate. Smith & Wesson actually got sued to add an extra hidden serial to their guns. A bunch of plastiguns have this kind of stuff for exactly this reason.
Also just scratching the surface smooth is not enough, and most people screw that up. The stamping leaves strain marks in the metal under the surface, and these can be recovered from a completely smoothed surface.
For example https://www.horiba.com/int/science-in-action/raman-breakthro... and https://digitalcommons.wku.edu/cgi/viewcontent.cgi?article=2...
These are just the tip of the iceberg for recovery techniques.