On a playthrough without biters, the SMG, uranium ammo, and laser defense provided on player creation are not needed.
With the Pacifist mod, these items even lead to errors, causing a crash (https://mods.factorio.com/mod/Pacifist/discussion/68c1cae2bfa887241fc3b286)
Consider either of the following:
- a map setting that enables/disables insertion of weaponry into the inventory
- detect whether enemies are enabled in the map gen settings and skip the insertion accordingly
- harden your mod against any mods that may remove the items by checking whether they actually exist before you insert them
I'd be happy to provide a patch for either of these options.