Yes recreational marijuana is not legal. Medical marijuana is legal with a doctors issued card. You do not have to be a resident to obtain a card, you will need authorization from a doctor. Although in order to purchase you must register and that require a Maine id. You are not permitted to travel with the marijuana as well.
If you have a medical card from your own state you can use marijuana legally as per medical marijuana use laws for up to a 30 day visit. You may not obtain marijuana in Maine with another states medical card. If you do not have a medical card at all, it is still technically illegal and a civil citation could be faced for using marijuana. Otherwise there is no difference between the laws for visitors or locals. If you are visiting, follow the laws.
No, and it’s a crime to knowingly posses marijuana in the state of Maine. The range of penalties varies not by state of residence but by amount and previous criminal record, ranging from fines to confinement. So this would be a bad idea under any circumstances. Only those with a valid medical card in the state can access it.