We've kept people alive on the ISS continuously for 26 years. That's built with leaky 1990s Russian hardware. Shipping sufficient food and air is nice and simple.
We've kept people in space for over a year multiple times. The danger for long stays in space is prolonged zero G, so in theory taking a layover on Mars would be beneficial.
But if you're worried about time then triple the fuel and you can cut the transit times to around 6 months each way, which also makes your return window more flexible. You send the majority of the kit (lander/return vehicle) into Mars orbit on a slow transfer and the people in a separate speedy unit.