Martial classes are already the most powerful classes in 5e without being able to freely swap weapons.
While I am loathe to appeal to popularity or authority, I think this is a case where anyone else stumbling upon this could use the context. I've never seen anyone who show an understanding of the 5e system reflect this opinion. It doesn't matter if you're looking for indepth guides for Solasta or tabletop 5e, the full caster classes are pretty much universally regarded as the strongest ones in the system, followed by Paladin and then by Gloom Stalker Ranger. It's usually only after these that you start to see other classes listed in terms of power or usefulness. At best, you'll find highly synergistic multiclass combinations among these, but that is about it and even they usually have to include the top classes.
If you are under the impression that the martial classes are the most powerful in 5e, the only thing I have to say is that you need to learn to cast spells and you probably need to learn to evaluate classes on what they're capable of doing besides just damage per round (DPR).
DPR is actually a very limited metric and usually isn't good at measuring anything but how martial classes compare to one another. An alternate way of measuring class effectiveness could be "actions denied" or "action economy manipulation". This would be a lot more time consuming and require a lot more specifics about a given situation, so it isn't hard to see why people usually aren't doing that. So let's take a hypothetical example.
A Fighter (without spellcasting) and a Wizard are both fighting their own ogre or whatnot. The Fighter, with their good DPR kills the ogre is 5 rounds. The Wizard having lower DPR, has to spend 10 rounds. So the Fighter is better, right? Wrong.
Since the Fighter has no means of denying actions outside of killing something, the ogre will have all of their 5 actions. The Wizard might take a bit longer, but they have a number of effects to deny or weaken the ogre's ability to do, well, anything. Even just in Solasta, we have Fog Cloud to impose permanent disadvantage, we have Hideous Laughter for hard CC, we even have Expeditious Retreat which would force the ogre to keep Dashing instead of attacking to get into range. Going into 2nd lvl spells, we have things like Spider Climb or Levitate to let you stay out of reach, or Ray of Emfeeblement to half the dmg the ogre does per attack. 3rd lvl we can use Haste to kite the monster and potentially double our dmg if we have a passable dex and a crossbow, or use Fear to prevent it from moving closer to us. 4th lvl and Greater Invisibility is going to counter such an encounter on its own. When fighting a decently played Wizard, the ogre might get 2-3 actions that impact the combat and would otherwise just have to keep using their turns to either chase after the Wizard or do nothing because they can't.
You wouldn't need to spend all of these spells to win this 1 v 1. One or two would probably suffice, and you've probably got plenty by the time you try. And this is about as favorable as a comparison as a Fighter could ever get. The more complicated the encounter, and when you have party members that can take advantage of the situations your magic creates, the more you can do with magic.
This isn't to say martial classes aren't useful to have in a party, but even they benefit greatly from having the spellcasting feature compared to if they don't have it. A simple example of this could be that fight with the ogre, but now the Fighter is competing with a Ranger. Setting aside that Rangers typically have pretty good DPR for lvl 2-10, let's look at how some of their spells could impact the fight. Fog Cloud, as mentioned, gives permanent disadvantage, which favors the side with more attacks and higher AC. Ogres have low AC and a single, powerful attack (for its CR). Spike Growth could rack up a significant amount of damage (5 dmg per 5 feet of movement on avg, + half walking speed) if the ogre is forced to go through rather than around it, and even if they can go around, that is a lot of free rounds for the Ranger to use their bow. Conjure Animal could let you turn the fight into a 3 on 1 with Dire Wolves, who have Pack Tactics and an automatic trip attack to manipulate the movementspeed of the ogre. Worst case scenario, the wolves function as ~70 temp HP while you wear down the ogre, which would take it about 5-6 rounds to get through. That's some 10 more actions for you from the Dire Wolves and 5-6 less actions for the ogre.
And, again, this is about as favorable as things get for the Fighter, because in a more complicated and dangerous encounter, the Ranger's spells could be used for greater impact. Like setting up Silence on a dangerous spellcaster.
This is just considering spells from Solasta. Go into tabletop and the options multiply, as does the power level of spellcasting with it.