The AbstractEbuildProcess._cancel_timeout_cb method calls self.wait() before the process exit status has become available, ultimately triggering recursion in the AbstractPollTask._wait_loop method.
This is fixed by calling _async_wait: https://gitweb.gentoo.org/proj/portage.git/commit/?id=87c079175c7a504ae893ed7d6ced03638d4cc853
Fixed in portage-2.3.32.