Peru has had a lot of bad press but if you use your common sense you’ll be fine. I live in Lima, for example the tourist areas here have a high police presence and are safe.
I felt kind of safe there, depends of a district. But I know personally a guy 1,9 meters, boxer, that got drunk and took a taxi, the guy drove him to darl alley where friends were waiting and took his stuff. So it is always about using your brain and a bit of luck. But that was more than 10 years ago. Maybe with uber, these situations are safer.