Thanks for the tips, Jim and Srdjan. The kernel compilation completed without trouble. In the end I did
mkdir /tamp mv /var/tmp/portage /tamp/portage echo "PORTAGE_TMPDIR = /tamp" >> /etc/make.conf ln -s /tamp/portage /var/tmp/portage
I'm writing this on the Gentoo installation I ended up with.
The only packages that left anything behind in /tamp/portage were the kernel and kdnssd-avahi. The latter, I suspect, because I accidentally interrupted its compilation part-way through.