If the mindflayer gets some lucky hits in you can just kill it with ranged. 16 dex will give you a 40% chance to hit for 1d8+3 with a crossbow, plus advantage if you have high ground, and Shadowheart's Sacred Flame is at 40% against his dex. With Shadowheart, Lae'zel and the Intellect Devourer you can focus it down. Hex helps, as do buffs.