if there was a spell that lets you be an unoptimized fighter for one turn even if you spend resources to get something the fighter has for free this would be the strongest spell in the game.
The "balance" of the game is that you can multiply the efficiency of the fighter
The polymorph spells more-or-less turn you into a level-appropriate generic martial, albeit reskinned to look like something else and likely getting some utility out of it as well (e.g. movement speed and/or senses). As an example, a 9th level martial will look something like this before class-specific shenanigans (e.g. rage, extra fighter proficiency):
Attack: +18 (expert proficiency +13, Str +4, item +1)
Damage: 2d8+4+1d6 energy one-handed, or 2d12+4+1d6 energy two-handed. These prioritize damage over tricksiness.
AC: 27 (base 10, trained proficiency +11, item + Dex +5, magic +1)
Looking at a 5th level polymorph-style spell, we have:
Elemental form (turning into an Earth elemental): Attack +18, Damage 2d10+9, AC 28
Aerial form (turning into a pterosaur): Attack +18, Damage 3d6+8, AC 27 (plus of course getting a flight speed, which ain't nothing).
Primal casters additionally have:
Animal form (various): Attack +18, Damage 4d8+8, AC 27.
Dinosaur form (various): Attack +18, Damage 4d8+6, AC 27.
Insect form (turning into a beetle): Attack +18, Damage 4d10+2, AC 27.
5th-level
animal,
dinosaur, and
insect form all turn you into a Huge creature, as opposed to the Large
aerial form or the Medium
elemental form, which might sometimes be relevant.