...to the base metal underneath at higher temperature. And as Yggdrasil is correctly pointing out, before the diffusion takes place, not that much happens, as gold is protecting metals underneath.
If you heat treat the pins, you usually disabled them to be processed efficiently with AP...