Nothing in ORS 163.408, 163.411 or 163.452 prohibits a penetration described in those sections when:
(1) The penetration is part of a medically recognized treatment or diagnostic procedure and is for a legitimate medical purpose; or
(2) The penetration is accomplished by a peace officer or a corrections officer acting in official capacity, or by medical personnel at the request of such an officer, in order to search for weapons, contraband or evidence of crime.