I’ve developed the habit of getting into a squat when searching the leg/groin area of a subject.
I see a lot of cops bent over with their heads down while searching the legs, putting their face in close proximity to the hands and elbows. Getting into the squat will keep your center of gravity low and will help maintain some distance which is helpful if you need to take the suspect down or react to their movement. You can keep your field of view up towards their arms/face as well to watch for pre-attack cues.