Having spent some time there, there are exceptions. We stayed in the Limon province, which from my understanding is the poorest. The town we were in was insanely safe. My wife could walk around alone after dark with no issues. But just 15 minutes away was Puerto Viejo de Talamanca. It's a party town with lots of drug activity. We heard reports of women being harassed and raped and that even groups of women weren't safe.
I don't know how much of that was true. I never looked into it. It was just rumors from the locals, but I trust them.
And from what I can tell, that's definitely not normal for Costa Rica.
If you ever get to go back to that area, just continue on down the road about 15 minutes to Manzanillo. The first restaurant as you get into town are room by my good friends. The Cool and Calm. Andy is usually out front grilling meats and blasting reggae.