Solo Female (24) Travel in Brazil (Rio or Sao Paulo) is it SAFE?

I want so badly to do a solo trip to Brazil. I have been once before with my then-boyfriend to visit his family and see where he grew up. I speak Portuguese at an advanced level and have been to many countries all over the world, including Colombia where I felt very safe. I stick out a lot, blonde hair, blue eyes fair skin. But I am a generally aware person, and I already have done some digging online and spoken with other solo travelers and it seems either city is quite safe for solo females. However, a lot of my close friends are from Brazil and they tell me do not go alone because it can be very dangerous. I am aware of this but in all the countries in the world I have been to I have only ever feared for my life in my hometown in the US . Basically I have the attitude that if it can work and be okay it will be okay as long as I am aware/smart etc. I am also wondering how I would go about going out as a solo female traveler, so as not to be drugged etc. Can anyone share their experiences traveling to these places, or anywhere in Brazil, and say your age and gender and your opinion on this? I would really appreciate it!

EDIT: Even if you are a straight man, I want all the opinions I can get please! Do not hesitate.

Solo Female (24) Travel in Brazil (Rio or Sao Paulo) is it SAFE?