The danger of MDMA is overstated. From an actual chemical toxicity standpoint it's relatively safe, accidental overdose would be next to impossible. You can have a gram in one go (average dose is somewhere around 80-250 mg), and although you'd probably feel pretty sick, you'll be fine.
Even the danger for dehydration/overhydration is overstated. Heatstroke is a danger when using it during the day in summer (e.g. at festivals), but that's more due to people not listening to their bodies and not knowing when to stop and take a break and get some shade/water.
Anecdotally it's a pretty safe drug. The main danger is generally "molly" (which I think is a really cringy name) that's not actually pure MDMA, but is instead laced with PMA or other more dangerous substances which are cheaper and easier to manufacture and import.
That's not to say that there isn't danger of harm and potential for abuse. Just that it's overstated by politicians and the police as a scare tactic. Most of the potential harm from MDMA can be mitigated with good education.