Annotating internal code with constexpr, consteval, and constinit

Since there exist #ifdef __cplusplus conditions throughout CPython’s codebase (not just for extern “C“)

Can you give an example of a change you’re proposing?

Using a set of macros to be defined somewhere in an internal header such as:

#ifdef __cplusplus
#ifdef __cpp_constexpr
#define Constexpr(x) constexpr x
#endif

#ifdef __cpp_consteval
#define Consteval(x) consteval x
#endif

#ifdef __cpp_constinit
#define Constinit(x) constinit x
#endif

#else
#if __STDC_VERSION__ >= 202311L 
#define Constexpr(x) constexpr x
#else
#define Constexpr(x)
#endif
#define Consteval(x)
#define Constinit(x)

#endif

My intention is to annotate as much of public C API when compiling native extensions with a C++ compiler, while not breaking compilation for C based extensions