It was purportedly (and probably in actuality) intended as a survival aid to be used after landings and before recovery in the Siberian wilderness, although allegedly was intended as a defensive weapon against in-space attacks by the US space program.
Firearms generally work in space at least once.
A semi-auto probably won’t cycle correctly in zero G, and any gun will likely overheat from the first couple shots in a vacuum, but you can always get one shot out.