The rapist isn't guaranteed not to be prosecuted if the victim doesn't hand over data. But you're right that a rapist careful not to leave behind too much other evidence is likely protected.
Not only that, but a rapist could use the threat of police investigation for something like recreational drug use to scare a victim into never going to the police in the first place.
This seems to have the potential of severe abuse, if a rapist is aware of such matters they would feel protected to carry out their travesties.
What the actual f* indeed.