Hey, I think I can answer this question. It really depends on what you are looking for, but here is my top 3:
1) Medellin, Colombia - While it has bad rep in the past, it's quite safe now. There are places where you shouldn't flash your camera, but that is mostly limited to poorer neighbourhoods. It's a fantastic city - Nice cafes, Spanish schools, Co-working spaces. It is also a great place to go to Cocora Valley, Guatape among other places. The nature is something from a movie. I can guarantee that you will fall in love with it. Sometimes it can be tricky to find a place with good internet connection, but that can be sorted out.
2) Playa Del Carmen, Mexico - Super safe and located next to the Caribbean coast. While apartments might be bit more expensive than in Medellin, you will find that food is soooo much cheaper than in Colombia. I've never used co-working spaces, but there are quite a few here. Internet is quite reliable.
3) Cusco, Peru - If you are more adventurous and not afraid of altitude, this is a place to go. Basically it is a central city from which to go to Machu Pikchu, Sacred Valley, Rainbow mountain e.t.c. While it is touristy, it is for a reason. In regards to safety, I never felt unsafe there. You'd need to find a place with good internet. We stayed in an AirBnB place that was half startup incubator / half apartment for rent and internet was quite good there.
There are others, but these cities might no be worth staying in for 3 months.