This has been fixed in [more recent versions](https://github.com/pybind/pybind11/commit/d27fdaa27287b46af3d29140251a730317d92a02) of pybind11.