C++ is tremendously bloated though, and wastes hundreds of instructions with stuff you shouldn't need to care about.
Such as? I don't believe any C++ compilers are producing extra machine code just for the fun of it.
So, don't use std::variant? To produce performant output from a C++ compiler, you have to make the same sort of informed decisions that you would if you were writing assembler. Possibly not using the standard library at all.