The main constraint with any system that boosts payloads on their way is the equal and opposite reaction element. So if you build your hypothetical launcher in earth orbit then each time you launch a mars mission through it boosting 'up' (increased orbital velocity) you push your launcher 'down' (lower orbital velocity).
Traveling between orbital stations or to the moon there are ways to model shots that equal out or 'catch' incoming payloads but for a mars shot that does not work as neatly so you end up needing similar fuel loads being boosted to orbit anyway, though you can potentially use a single high efficiency/low thrust engine on your launcher in place of multiple lower efficiency/high thrust engines on your payload which may make for some gains.
Placing your launcher on the moon has a number of advantages here as you get access to materials and a massive launch platform that in human terms can be considered immovable.
Regardless of location such a launcher will be massive, the months longs mars transits involve DV of 3km/s from and up from LEO so your system muzzle velocity needs to be 3km/s. At 5G that means accelerating for just over a minute and a length of around 100kms. Doubling to 10G acceleration around about halves the system length to 50km. That is a substantial structure to build, keep straight against tidal forces and keep pointed accurately.
Also note your launch system in LEO will be a highly effective weapon against anybody in the earth/moon system so politically exciting to have around.