Bazel 8 introduced a new macro paradigm, called symbolic macros, that "offer typed arguments and the ability to restrict and specify the visibility of targets created".
Consumption could likely mean dropping support for < Bazel 8, though there might be some strategies to mitigate this.