Librem 5 - is it the software or the hardware?

This is mostly software. For improved WiFi, you should try upgrading the RS91116 firmware.

I don’t think that there is much that Purism can do about the heat of the BM818 cellular modem. Maybe BroadMobi will release new firmware in the future that reduces that, but M.2 modems are known to run hot, which is why they have big heat spreaders.