I'm pretty sure the optimal way is concentrating on a single damage type, and not only because of the things I mentioned. They might have wanted to create a system in which a more varied approach is better, but they failed. Besides, I don't want to be "encouraged" to play the parties they want me to, I want to create my own.
The optimal way to play is to focus on physical. At 1 point I got into an internet argument with someone over this about 2 years ago and I autistically took screenshots of the stats of every single boss in the game as well as their henchman to prove the point. Contrary to what people believe, although in
theory it makes sense to have a physical damage dealer focus on physical and a magical damage dealer focus on magical, most enemies in the game either have higher magical armour than physical armour, or their elemental resistances cause their effective HP to be higher regardless. There are only 2 enemies in the entire game that have physical resistance, the first is those bat demon things which are encountered in act 2 in Morgus's (spelling?) cave and the 2nd is a reflection of yourself which is encountered in 1 of the source point dream things when you inhale the magic smoke. If someone wants to see those screenshots as evidence, I can probably dig them up.
Even in the first act of the game there are enemies with immunities to specific magical damage types (nature, fire) and as the game goes on, the issue only gets more and more pronounced. Pretty much the ideal way to play if all you care about is optimization is a character that dumps almost all of their points into warfare, with 1 or 2 dips into other schools for abilities (for example, scoundrel for adrenaline and polymorph for stuff like skin graft or chameleon cloak). If you take this approach, even soloing the game without lone wolf is not very hard and by the time you get to the final fight, you can 1 round kill the final boss, completely denying them an opportunity to participate in the fight. You don't even need to respec for this either, you can play a single build throughout the entire game.
Playing the game like that is not very fun though, in fact, I would actively recommend avoiding playing physical builds because of how easy they make the game. DOS:2 must be 1 of the only RPGs where playing a caster is gimping yourself. The game is still fairly easy if you play a caster, especially if you use the OP spells like detonate corpse or traps, but there are far less broken spells and abilities to avoid on casters than there are on physical builds. At the end of the day though, the game is pretty easy. There was a video some years ago of a guy 1 shotting all the bosses with some of the most creative stuff i've seen (not barrels, I promise), unfortunately it not nuked on youtube otherwise i'd link it.