Just to be clear on what is included here:
- All courses from Super Mario Kart
- All courses from Mario Kart 64
- All nitro and retro courses from Mario Kart: Super Circuit
- All courses from Mario Kart: Double Dash
- All nitro and retro courses from Mario Kart DS
- All nitro and retro courses from Mario Kart Wii
- All nitro and retro courses from Mario Kart 7
- All nitro, retro and DLC courses from Mario Kart 8, plus the different variants of Animal Crossing
- All nitro, retro, Wii U DLC and BCP courses from Mario Kart 8 Deluxe, plus the different variants of Animal Crossing
- All regular courses, routes and Knockout Tour rallies from Mario Kart World
- All courses from Mario Kart Arcade GP, including the variants that appear in different rounds, and including variants that appear in the special cups (some of these variants appear to be identical to other variants of the courses but in other cases they appear to be different and there's not enough info online about which courses got all unique variants and which didn't so I'm just counting all the rounds as being separate variants for simplicity)
- All courses from Mario Kart Arcade GP 2, including the variants that appear in different rounds, and including variants that appear in the special cups (same deal as the original arcade game)
- All courses from Mario Kart Arcade GP DX (there do not appear to be variants in this game and the special cups are basically just mirror mode)
- The course form Mario Kart Arcade GP VR
- All course themes from Mario Kart Live: Home Circuit, including from the update
- All courses from Mario Kart Tour, including the retro, city, nitro and RMX courses, as well as different numbered versions of city courses, Kalimari Desert and Piranha Plant Cove and all of the R, T and r/T variants of courses that received them.
What I have not included:
- Randomised variants of courses such as Excitebike Arena
- Battle courses
- Course variants appearing in challenges
- Different versions of courses such as Coconut Mall in the BCP or routes to and from Koopa Beach in World
- Alterations to courses when playing in multiplayer in games such as Mario Kart Wii
- Mirror mode versions
- Unofficial or fanmade courses
- Beta courses or courses that never made it into the final game
- Courses from games that are related to the Mario franchise but are not explicitly Mario Kart games, such as Diddy Kong Racing
- Any form of race in other Mario games (Koopa the Quick races, Bound Bowl races in Mario Odyssey, the moped races in Mario Party 8, and so on)
If you add all of this up, you could conclude that there are 1278 courses, including variants (although obviously counting some of these as separate variants is dubious at best)