I’d recommend 8” from door opening. You have a double stud (sometimes more for lights, outlets, switches, etc. Your studs are typically 16” apart. If you aim between 8” and 12” you are more likely to find a hollow wall spot.
Of course this assumes worst case scenario in a load bearing wall. I know I’m splitting hairs, but trying to just barely miss the studs is not advisable. Fire 3 between them. Stop, listen, repeat, reload.
Yea, I’d go a full foot from the door frame edge. The normal stance for someone pondering entrance is to bend over toward the door with head extended.
maybe get a dog, it might save some issues down the road.
and yeah, never shoot if you cant see what you are shooting at, thats like rule three, after dont look down the barrel to see if the gun is loaded, that kind of rule.