In terms of physical safety, Cuba is a dream destination for women travelers. Most streets can be walked alone at night, violent crime is rare and the chivalrous part of machismo means you'll never step into oncoming traffic.
But machismo cuts both ways, protecting on one side and pursuing – relentlessly – on the other. It can be tiresome to go out alone at night and steel yourself against the onslaught of pretendientes (men courting), unless you're really keen on them or improving your Spanish. There's also relatively few solo travelers in Cuba and no youth hostels which means fewer travelers to keep company with.
Cuban women are used to piropos (the whistles, kissing sounds and compliments constantly ringing in their ears), and might even reply with their own if they're feeling frisky. For foreign women, however, it can feel like an invasion.
Ignoring piropos is the first step. But sometimes ignoring isn't enough. Learn some rejoinders in Spanish so you can shut men up. No me moleste (don't bother me), está bueno ya (all right already) or que falta respeto (how disrespectful) are good ones, as is the withering 'don't you dare' stare that is also part of the Cuban woman's arsenal. Wearing plain, modest clothes might help lessen unwanted attention; topless sunbathing is out. An absent husband, invented or not, seldom has any effect. If you go to a disco, be very clear with Cuban dance partners what you are and are not interested in.
Women must bring their own tampons (non-existent in Cuba) or pads (called íntimos, literally 'intimates').