I completely agree with posters who say let a male prison guard identify as female for the duration.
a male officer will search the genitalia of a trans woman and a female officer the top half.
Apart from this being completely insane, let that particular guard identify as non-binary.
In fact all the prison guards could identify as non-binary.
Job done.
They are neither male nor female, so no one can object.
No name change necessary, no pronoun change necessary.
Ffs.