After my previous discovery I thought surely there should also be an easy keyboard shortcut for swapping the foreground and background colours in the GIMP, even though it doesn’t seem to be documented anywhere. There is. Just press X.
Actually I think it would be useful if this was shown in the tooltip text when you hover over the colour switching button, like it does with the other tools. If you’re curious, here is a list of 74 keyboard shortcuts for the GIMP (including this one) that you might not have known otherwise. I think keyboard shortcuts are great for editing pictures because you can change tools (and now also swap colours) without moving your cursor away from where you’re drawing!