In terms of overall career Ohtani is unlikely to stay healthy enough to be this effective as a pitcher forever so McDavid/Mahomes will have better overall careers, but based on how Ohtani has played in the past 3 seasons he's the only answer until he declines on one side of the ball or the other. McDavid and Mahomes are better relative to their peers/historical comparisons at their position (Ohtani has no real argument for being a top 5 all time hitter or pitcher individually), but as a total package he's absolutely been more dominant over the past 3 years and you could legitimately argue that 2021-23 Ohtani is the single greatest 3-year span from any baseball player in history. If you don't follow baseball it's difficult to express just how valuable a player he is. It's completely unprecedented in over 150 years of the game's history, there's never really even been a guy that's been just "good" at both roles at the same time, and he's a legitimate superstar talent on both sides of the ball.
There's a catchall offensive production stat in baseball called weighted runs created (wRC+) which aggregates all value a player provides at the plate, and it's expressed as a base-100 percentage stat where 100 is exactly league average, 150 wRC+ is 50% better, 50wRC+ is 50% worse, and so on. Ohtani is leading the majors at a 183 wRC+ ahead of Freddie Freeman (who's a perennial superstar hitter) at 165. Pitching numbers are harder to explain if you're not familiar with baseball and there's more nuanced to it so I'll just say that he's currently 12th in the majors in one of the two major wins above replacement stats, and was easily top 5 as a pitcher last year. If you cloned him and each clone had to stick to one role, he would be a franchise player worth 25-30 million a year in each role (and the hitter clone would be even more valuable as a hitter than right now because he would play the field instead of DHing).
It's hard to make a hockey analogy since you can't play as a goalie and skater at the same time, but the analogy I'd make is probably something like if Mikko Rantanen could clone himself and simultaneously play 20 minutes a night for 70-75 games a year as a superstar winger while also making 55 starts as a goalie who's as good as Juuse Saros. In football terms Mahomes is a better QB than Ohtani is a hitter, so you could consider it something like maybe a Justin Herbert level QB who's also a top 10 pass rusher in the NFL and plays a starter's workload on defence.