I think you will be in for an exciting time here in Madagascar. Mahajanga is more of a quiet community, as in there are very few foreign tourists as there is not much in the way of tourist attractions. Mahajanga is more favorable for domestic tourists who want to spend some time at the beach and enjoy fresh seafood not found in the interior of the island.
Ex- pat hangouts are in cafes and bars, mostly concentrated in the main area of Mahajanga--called Mahajanga-be (" be" means big even if the area it actually covers is small).
There is a gathering place you might like to visit called Alliance Francaise, and you may want to introduce yourself to the local school , College Francaise which has a younder crowd of teachers, rather than the expats that are pensioners hanging at the bars and cafes.
Health is about being careful around unclean areas, mosquitoes are a concern so a netting at night is very important and can be bought in Mahajanga for a reasonable price. In fact as you are already aware of that local products and goods are cheaper in the local community from your experiences in Costa Rica.
Electronic equipment comes from China or Bangkok perhaps Europe and India but there are not many choices and quality varies, and once you buy it then you own it as in no warranties or if you are lucky maybe one month. Also the prices are close to double what you can buy in France. Also when you come through the airport, make sure your new equipment is not boxed so as to avoid taxes.
Also most electronics are android--not apple- so if you need a repair then you can find someone to help you with an android.
Robberies are everywhere but recently are conducted by young boys ages from 12 to 20 that gather in groups of 7 to 20 children. Best to more careful in the evenings and travel by car.
If you plan on learning the local language, then I suggest you go with the dialect found in this part of the country which is Sakalava. There are 18 different tribes, each with their own dialects. and there are undercurrents of snobbery towards each tribe
Finding a place to live will depend on your transportation needs. If you have a car you will need to find a place that has security at night or a locked gate even night time security.
Public transportation in town is cheap and many types to choose from such as Tuk Tuk a three wheel motorbike that will cost about 50 cents or less for one way for getting around most of town.
Patience is number one------- is going to be a great asset and in the long run can protect you from robbery and harm in the future. People are thin skinned and are hurt easily and losing face is a feeling of being close to death for the locals.
As you already know from your travels in Central and South America that when you met people who can speak your language very well then you need to be on the alert for how helpful they can act and soon it starts to smell like a scam. They will know your culture better than you know their culture. Most people don't have a education level of more than 6 grades and French is not taught to a high level in the schools because the teachers themselves lack French skills so will teach and explain in Malagasy.
Bargaining skills is number two-------almost nothing in the market is priced, so you will be offered a price higher because you are a foreigner.
Not much has changed in costs- perhaps 5 to 10% but with the change of money of the Euro or dollar which is to our advantage to slow down those rising costs, not so for the local worker that get paid in the local money---Ariary
https://www.expat.com/forum/viewtopic.php?id=652490 I am curious if your company that you are working with has offered you seminars on Madagascar and Malagasy Language and understanding the customs and culture?
And which development sector you will be working in when you come to Mahajanga. ?
Alex