In BG1 and 2, I played a sorcerer. You know, they really need to get the sorcerer class out for BG3 soon. That might help peoples perceptions of spellcasters. The sorcerer differs from the wizard in that you get more spell slots but the tradeoff is you can't learn as much of a variety of spells.
By level 10, my sorcerer had like 45 HP and could hurl tons of spells each day. I was casting fireball on everything, and I made him more of a summoned, wiping the floor with enemies left and right and summoning wyverns and goblins and ogres and such to fight for me.
But in those games, every long rest in the wild was a chance random encounter. That's how they limited it. The only safe place was an inn at a city.
Most of those encounters really weren't that dangerous. I've found scroll availability to be more limiting when playing BG1 for the first time, considering the original didn't have the sorcerer class and high level scrolls were rare. But once you find a few wands, it doesn't matter anymore, because both BG1 and BG2 let you recharge wands in shops, so mages don't have to rely on their spellbooks for offensive spellcasting.