Caution is always good, and I would NEVER suggest to anyone, male or female, Indonesian or foreign, that they fail to be be mindful of their surroundings. Everyone, regardless of nationality or gender, should try to avoid behaviors that unnecessarily increase their personal risk.
Having said that ... my personal observations about foreigner safety in Indonesia are that it's young foreign guys who cruise bars looking for a local girlfriend (or one night stand, or prostitute, take your pick, personally I don't judge too much) that are the biggest targets. I personally know and can vouch for the stories of several foreign guys who were roofied/taken advantage of because they were "on the prowl." One guy I knew personally nearly died, he was given such a large dose of rohypnol/ketamine.
As a woman who conducted a lot of activities on my own in Indonesia for 17 years, I never felt particularly vulnerable because of my gender. I'd rather walk alone at night on a street in Jakarta than I would in any American big city, for sure.
That doesn't mean the statistics prove my attitude is objectively defensible. I'm just reporting on how it was for me: as a foreign woman in Jakarta, I often felt harassed in the sense that I was viewed as very approachable, and too many people wanted to befriend me for conversational purposes. But I NEVER felt unsafe in terms of expectations of rape or violent crime (pickpocketing, sure, that's always something to be on the lookout for...hold your valuables close to you and hard to grab; that's good advice anywhere in the world.)
A walk in the dark alone in Boston or DC felt far scarier to me than a walk in Jakarta ever did.