Python-related build-failure on the 2.9 branch

I cannot build the releases/2.9 branch on my up-to-date Debian testing machine. After a fresh clone, I get

~/dune-2.9> ./dune-common/bin/dunecontrol all
--- going to build dune-common dune-geometry dune-localfunctions dune-uggrid dune-grid dune-istl dune-matrix-vector dune-solvers dune-typetree dune-gmsh4 dune-functions dune-fufem dune-elasticity dune-gfe  ---
--- calling all for dune-common ---
--- calling vcsetup for dune-common ---
--- calling cmake for dune-common ---
cmake     "/home/sander/dune-2.9/dune-common"
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test cxx_std_flag_17
-- Performing Test cxx_std_flag_17 - Success
-- Performing Test compiler_supports_cxx17
-- Performing Test compiler_supports_cxx17 - Success
-- Looking for std::experimental::make_array<int,int>
-- Looking for std::experimental::make_array<int,int> - found
-- Looking for std::move<std::experimental::detected_t<std::decay_t,int>>
-- Looking for std::move<std::experimental::detected_t<std::decay_t,int>> - found
-- Looking for std::identity
-- Looking for std::identity - not found
-- Performing Test DUNE_HAVE_CXX_UNEVALUATED_CONTEXT_LAMBDA
-- Performing Test DUNE_HAVE_CXX_UNEVALUATED_CONTEXT_LAMBDA - Failed
-- Found LATEX: /usr/bin/latex   
-- Found LatexMk: /usr/bin/latexmk (found version "Version 4.79") 
-- Could NOT find Sphinx (missing: SPHINX_EXECUTABLE) 
-- Found Doxygen: /usr/bin/doxygen (found version "1.9.4") found components: doxygen dot 
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1") 
-- Performing tests for dune-common (from /home/sander/dune-2.9/dune-common/cmake/modules/DuneCommonMacros.cmake)
-- Set Minimal Debug Level to 4
-- Looking for sgemm_
-- Looking for sgemm_ - not found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Looking for dgemm_
-- Looking for dgemm_ - found
-- Found BLAS: /usr/lib/x86_64-linux-gnu/libblas.so;/usr/lib/x86_64-linux-gnu/libf77blas.so;/usr/lib/x86_64-linux-gnu/libatlas.so  
-- Looking for cheev_
-- Looking for cheev_ - not found
-- Looking for cheev_
-- Looking for cheev_ - found
-- Found LAPACK: /usr/lib/x86_64-linux-gnu/liblapack.so;/usr/lib/x86_64-linux-gnu/libblas.so;/usr/lib/x86_64-linux-gnu/libf77blas.so;/usr/lib/x86_64-linux-gnu/libatlas.so  
-- Looking for dsyev_
-- Looking for dsyev_ - found
-- Found GMP: /usr/lib/x86_64-linux-gnu/libgmpxx.so  
-- Performing Test QuadMath_COMPILES
-- Performing Test QuadMath_COMPILES - Success
-- Found QuadMath: (Supported by compiler)  
-- Found MPI_C: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so (found suitable version "3.1", minimum required is "3.0") 
-- Found MPI: TRUE (found suitable version "3.1", minimum required is "3.0") found components: C 
-- Could NOT find TBB (set TBB_DIR to path containing TBBConfig.cmake or set PKG_CONFIG_PATH to include the location of the tbb.pc file) (missing: PkgConfigTBB_LINK_LIBRARIES PkgConfigTBB_FOUND) (found version "")
-- Could NOT find PTScotch (missing: SCOTCH_LIBRARY SCOTCHERR_LIBRARY SCOTCH_INCLUDE_DIR) 
-- Found METIS: /usr/lib/x86_64-linux-gnu/libmetis.so (found version "5.1") 
-- Found METIS: /usr/lib/x86_64-linux-gnu/libmetis.so (found suitable version "5.1", minimum required is "5.0") 
-- Found MPI_C: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so (found version "3.1") 
-- Found MPI: TRUE (found version "3.1") found components: C 
-- Found ParMETIS: /usr/lib/libparmetis.so (found suitable version "4.0", minimum required is "4.0") 
-- Could NOT find Vc (missing: Vc_DIR)
-- Found Python3: /usr/bin/python3 (found version "3.11.2") found components: Interpreter Development Development.Module Development.Embed 
-- Found pip_/usr/bin/python3: TRUE  
-- Failed to find the python package virtualenv with interpreter /usr/bin/python3. (missing: DUNE_PYTHON_virtualenv_FOUND) 
-- Found venv_/usr/bin/python3: TRUE  
-- Building a virtualenv in /home/sander/dune-2.9/dune-common/build-cmake/dune-env
-- Found pip_/home/sander/dune-2.9/dune-common/build-cmake/dune-env/bin/python: TRUE  
-- Using scripts from /home/sander/dune-2.9/dune-common/cmake/scripts for creating doxygen stuff.
-- using /home/sander/dune-2.9/dune-common/doc/doxygen/Doxystyle to create doxystyle file
-- using C macro definitions from /home/sander/dune-2.9/dune-common/doc/doxygen/doxygen-macros for Doxygen
-- Skipping building CMake API documentation (Sphinx was not found!)
-- Installing python package abstract requirements: jinja2 mpi4py numpy pip>=21.a portalocker setuptools>=41 wheel 
-- Installing python package at /home/sander/dune-2.9/dune-common/build-cmake/python/. into Dune virtual environment 
-- Generating the CMake metadata file at dune/data/dune-common.cmake
-- Not adding custom target for config.h generation
-- The following OPTIONAL packages have been found:

 * LATEX
 * LatexMk
 * Doxygen, Class documentation generator, <www.doxygen.org>
   To generate the class documentation from C++ sources
 * BLAS, fast linear algebra routines
 * LAPACK, fast linear algebra routines
 * GMP, GNU multi-precision library, <https://gmplib.org>
 * QuadMath, GCC Quad-Precision Math Library, <https://gcc.gnu.org/onlinedocs/libquadmath>
 * Inkscape, converts SVG images, <www.inkscape.org>
   To generate the documentation with LaTeX
 * Threads, Multi-threading library
 * METIS (required version >= 5.0), Serial Graph Partitioning, <http://glaros.dtc.umn.edu/gkhome/metis/metis/overview>
 * MPI, Message Passing Interface library
   Parallel programming on multiple processors
 * ParMETIS (required version >= 4.0), Parallel Graph Partitioning, <http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview>
 * Python3

-- The following OPTIONAL packages have not been found:

 * Sphinx, Documentation generator, <www.sphinx-doc.org>
   To generate the documentation from CMake and Python sources
 * TBB, Intel's Threading Building Blocks, <https://github.com/oneapi-src/oneTBB>
 * PTScotch, Sequential and Parallel Graph Partitioning, <https://gitlab.inria.fr/scotch/scotch>
 * Vc, C++ Vectorization library, <https://github.com/VcDevel/Vc>
   For use of SIMD instructions

-- Configuring done
CMake Warning (dev) in doc/comm/CMakeLists.txt:
  Policy CMP0087 is not set: Install CODE|SCRIPT allow the use of generator
  expressions.  Run "cmake --help-policy CMP0087" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /home/sander/dune-2.9/dune-common/build-cmake
--- calling make for dune-common ---
build directory: build-cmake
cmake --build . -- 
[  0%] Building CXX object CMakeFiles/dunecommon.dir/dune/common/debugalign.cc.o
[ 20%] Building CXX object CMakeFiles/dunecommon.dir/dune/common/debugallocator.cc.o
[ 20%] Building CXX object CMakeFiles/dunecommon.dir/dune/common/exceptions.cc.o
[ 20%] Building CXX object CMakeFiles/dunecommon.dir/dune/common/fmatrixev.cc.o
[ 20%] Building CXX object CMakeFiles/dunecommon.dir/dune/common/ios_state.cc.o
[ 40%] Building CXX object CMakeFiles/dunecommon.dir/dune/common/parametertree.cc.o
[ 40%] Building CXX object CMakeFiles/dunecommon.dir/dune/common/parametertreeparser.cc.o
[ 40%] Building CXX object CMakeFiles/dunecommon.dir/dune/common/path.cc.o
[ 60%] Building CXX object CMakeFiles/dunecommon.dir/dune/common/simd/test.cc.o
[ 60%] Building CXX object CMakeFiles/dunecommon.dir/dune/common/stdstreams.cc.o
[ 60%] Building CXX object CMakeFiles/dunecommon.dir/dune/common/stdthread.cc.o
[ 80%] Linking CXX static library lib/libdunecommon.a
[ 80%] Built target dunecommon
[ 80%] Building CXX object python/dune/common/CMakeFiles/_common.dir/_common.cc.o
In file included from /home/sander/dune-2.9/dune-common/dune/python/pybind11/attr.h:13,
                 from /home/sander/dune-2.9/dune-common/dune/python/pybind11/pybind11.h:45,
                 from /home/sander/dune-2.9/dune-common/dune/python/common/typeregistry.hh:21,
                 from /home/sander/dune-2.9/dune-common/dune/python/common/dynmatrix.hh:15,
                 from /home/sander/dune-2.9/dune-common/python/dune/common/_common.cc:10:
/home/sander/dune-2.9/dune-common/dune/python/pybind11/cast.h: In function ‘std::string pybind11::detail::error_string()’:
/home/sander/dune-2.9/dune-common/dune/python/pybind11/cast.h:446:36: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
  446 |                 "  " + handle(frame->f_code->co_filename).cast<std::string>() +
      |