The issue (after some experimenting) seems to be that putting the “host” directive on a function forces it to get C+±style name mangling in the output object file, except in the case of main(). I assume that main() has been given a special case, due to its obvious significance when starting C and C++ programs.
There were two solutions I found:
Remove host from functions you want to call from Python. The host directive is almost never used except with device to force a function to be compiled both for the CPU and the GPU. By default, all functions without either directive are compiled for the CPU.
Enclose functions you want to call from Python in an extern “C” block: