It seems that the Legacy Python Bindings of notmuch are deprecated in the release Notmuch 0.39 (2025-03-15). To quote from the release notes:
Legacy Python Bindings
The legacy python bindings previously in bindings/python are no
longer supported. These bindings have been deprecated since 2020. As
of this release they are no longer built or tested, and patches for
them will no longer be accepted. They have been moved to contrib to
smooth the transition. Thanks very much to Sebastian Spaeth and all of
the other contributors to these bindings over the years.
This breaks afew in a standard install of notmuch (for example on arch-linux). Is there a plan to move afew to the new cffi-based bindings?