Safety for women
When attention becomes intrusive, it can help if you are wearing a wedding ring and have photos of 'your' husband and children, even if they are someone else's. A good reason to give for not being with them is that you have to travel in connection with your job – biology, zoology, geography, or whatever. (But not journalism – that's risky.)
Pay attention to local etiquette, and to speaking, dressing and moving reasonably decorously. Look at how the local women dress, and try not to expose parts of yourself that they keep covered. Think about body language. In much of southern Africa direct eye-contact with a man will be seen as a 'come-on'; sunglasses are helpful here.
Don't be afraid to explain clearly – but pleasantly rather than as a put-down – that you aren't in the market for whatever distractions are on offer. Remember that you are probably as much of a novelty to the local people as they are to you; and the fact that you are travelling abroad alone gives them the message that you are free and adventurous. But don't imagine that a Lothario lurks under every bush: many approaches stem from genuine friendliness or curiosity, and a brush-off in such cases doesn't do much for the image of travellers in general.
Take sensible precautions against theft and attack – try to cover all the risks before you encounter them – and then relax and enjoy your trip. You'll meet far more kindness than villainy.