Deprecating a C++ function wrapped with pybind11 currently requires a pure-Python file to be added so deprecate_pybind11 can be used on the wrapped function. This is an unfortunate amount of boilerplate for something we want to keep lightweight, and it also ensures that a deprecation warning is still emitted when compiling the pybind11 module.
It should be possible to have a pure-C++ way to invoke deprecate_pybind11 (i.e. by importing it using pybind11 APIs) while squashing compiler warnings. The latter may require that this be a macro - we'll see - but that's a price worth paying to avoid spurious compiler warnings.
Kian-Tat Lim, before I spend any time on this, did you try anything like this when putting together deprecate_pybind11?