Physical vs Digital
It's relatively difficult to smuggle physical weapons around, and happily, the more dangerous they are, then in general the harder to infiltrate. Shifting a vanload of assault rifles is much harder than sneaking a small handgun, but infinitely easier than trucking a nuke. Plus there are lots of methods for detecting dangerous physical items: fluoroscopy, gamma ray scanners, chemical detectors, dogs etc.
None of these things holds true for code. It's barely the work of a minute to encrypt a file as random bytes. Or steganograph it into a photo album or music library. Just post a photo on a public service, even.
So perhaps instead of wasting effort trying slam the stable door, intelligent lawmakers (yeah, I know, stop laughing) should be working on schemes such as regulation of IoT manufacturers do they cannot sell unsecured, vulnerable rubbish?