iMac Target Display Mode black screen
On closer inspection, it looks like the display is not actually uniformly black. This led me to conclude that perhaps the backlight was just not turned on properly, and led me to discover the following workaround:


Log into the iMac
Change the brightness to a different level (e.g. up or down by one). The level seems to need to be different from the one previously used.
Enable Target Display Mode again, by pressing Command+F2