What, pray tell, is an "illegal 'taking?'"
Huh?
Be safe.
If the police do a traffic stop and seize your gun, that is illegal. That is an illegal taking. Similarly, collecting data or information that is not authorized by a specific law is an illegal taking of data that may be protected by another law.
Does the state require gun registration? If so, writing down the SN is authorized. But the NICS purchase [Brady] specifically does not allow retention of SN or names except when the check is failed and has become criminal.
Kansas, has no state gun registration and for the CCH [CCW] make, model or SN are NOT required. State law in Kansas allows an officer to "hold" a firearm during a stop if the officer feels it is advisable. In Kansas the law does not require that a CCH present or state they are licensed unless asked.
It is recommended [some states do require, getting one pattern is probably advisable].
But holding as gun for officer safety does not authorize taking data or making an illegal search. If you have a CCH and there is no other probable cause, why would an officer even want to see the gun, after all criminals carry guns a lot and have no license and commonly carry stolen weapons.
The stolen gun problem does exist and maybe a few lawful gun owners and licensed CCH might have a purchased a stolen gun, but doing a records check when no other cause except, "I can do it" constitutes creation of gun registration.