It gets less warm than you'd think.
I did mess around over a few days with a hub motored bike with an external battery (most things are exposed so you can monitor things more easily).
The warmer bits are the brake caliper and the actual cable going to the motor :
View attachment 128982
Different day : again, the power cable is the warm bit at the motor end :
View attachment 128983
Battery end : The cross is the bottom of the battery, where the cables and the battery control unit is. The warmer area under there is the frame which is acting as a heat sink. Interestingly (well, if you're sad

), you can see there's actually heat build up in the chain too.
View attachment 128984
I did recently test the battery temperature on the E-Mythique (Bafang M510). Test results over 7k, whilst trying to keep motor at max assistance (600+ Watts) - similar to my Gen4 in how it feels. 630wh battery. 5 Degree Celsius increase in battery temperature. Aluminium framed bike and underside of the battery is an exposed plastic case.
View attachment 128987
Unrelated, but interesting on the M510 you can monitor the torque sensor reading. 750 ish is no contact. The others are my foot resting on the pedal when taking screen captures - nice for testing if your Torque sensor is working properly.
Also totally unrelated, brake disks on different days after short runs.
View attachment 128981
View attachment 128985