Have access to a weapons crate (or a dead body) containing a pistol and ammo.
Without accessing the container, drop your weapons on the ground nearby via your own inventory.
Access the container, then take a pistol and its ammo.
Exit the gear menu.
Your character should be holding the pistol, but acting as if he were unarmed.