Building on the answer by @David Faure, I have the following simpler method:
find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module NumPy)
find_package(Boost 1.82 REQUIRE COMPONENTS
python${Python_VERSION_MAJOR}${Python_VERSION_MINOR}
# uses the versions found by find_package(Python3 ...) above,
# without string parsing silliness
The CMake documentation for finding Python3 helped me know to use the variables Python_VERSION_MAJOR
and Python_VERSION_MINOR
.