Over my like I've been in some unfriendly places (many in the U.S., as well as elsewhere). If you have to be there alone or with others who are prepared to deal with adversity by first avoiding it, then doing whatever is necessary, then that's one thing. To mix that with a relaxed cruise or happy retirement is a very different sort of experience that very few of us really would find enjoyable.
You could go kayaking with saltwater crocs or sleeping in a tree sling with Black Mambas or...
I think there are places where you can transit the tropics which are less rather than more dangerous. Costa Rica probably isn't one of them. Though there are fewer people killed than just hurt or very irritated by being scared all the time.
It's really sad. My sister and her husband (she a professor of Neurology and he, a retired professor of medeival literature) toured Costa Rica about 15 years ago. Unaccompanied in a rental car, they enjoyed the people and countryside a lot. NO PROBLEMS. Today, well that would be different story.
I'm not sure how much safer you'd feel inside your boat with some pissed-off armed robbers on the outside wanting in. It's not my idea of fun. If your choice is anchor or visit there, or move on by...I'd get on by...