fix(native_enum): diagnose duplicate member names in debug builds (#6239)

— codex on behalf of Ralf —

Report the enum and member name when a native_enum member name is
registered twice in a debug build. Keep the additional set allocation and
scan behind !NDEBUG; release builds retain Python Enum's validation.

Test both configurations using a condition exported from the C++ test
translation unit, and verify that a failed enum is not installed.

Fixes #5853.

Co-authored-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
3 files changed