Not true for the new guns either. For example Glock’s serial number is a small metal plate embedded into the polymer.
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.