I can initialize a variable at compile time using constexpr, but this makes the variable immutable (i.e. const).
I want a variable that is guaranteed to be initialized at compile time, but that I can still mutate/modify at run-time.
i think there should be non const and compile time evaluated variable.
Take a look at C++20's constinit.
constinitexists in C++20, it can only be applied to static and thread-local objects. Its main purpose is to prevent the static initialization order fiasco, not to provide a "compile-time constant but mutable" variable. The latter concept is not that useful, but if you really need it, it can be emulated by making a non-constcopy of aconstexprvariable.