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.