Been to both Panama and Costa Rica, and also (had a short visit in Mexico City), Cancun and Cozumel. If you stick to tourist areas, you should be pretty safe.
Want to expand a little on my previous post. Even in a seemingly safe place as Costa Rica, we were told that it was not a very good idea to rent a car and drive around the country on your own.

