I would simply not write the law, since I am an anarchist and I oppose laws.
As a point of agreement within a freely associated anarchist community...it would depend on the needs of the people. Like there might be communities where the members freely agree to not own guns, or communities where members freely agree to all own guns, or something else.
Personally, my preferred approach would be to share gun ownership, maintenance, training, and regular usage collectively within a small community of a couple hundred people at most. The hope would be that the community is small and safe and we all know and trust each other, so we wouldn't need to carry guns all the time around each other. But then if we needed to defend ourselves against tyrants, we would collectively be armed to the fucking teeth and trained to use these tools. But I would never want to impose this approach.