I think you're overestimating how equally effective a caster can be with both melee and casting. To be viable at melee there are a lot of spellcasting feats that a caster would have to sacrifice and fitting them in would be tricky. Improved Critical isn't possible on a pure until level 18, that means if you want to go twf or thf line, you'd have to start at level 9. THF would require a strength of at least 13 and TWF would require a dex of at least 15. There's still power attack, cleave and great cleave, which would leave no room for any metas, focuses, or whatever else. Overwhelming crit would be impossible. Furthermore investing in Eldritch means less investment in the spellcasting trees.
All in all this means less spell damage, less spells landing, less spell focused abilities.
Some extra melee damage, but how much? Nothing compared to a fighter, barb or even bard that all have better trees and abilities for melee focused toons.
As I said, there's plenty that a melee focused caster would have to sacrifice.
As for dwarf, I don't think that's a fair comparison. Dwarf is a race, not an enhancement, you can build a dwarf as whatever you want, they can just get extra con is all.