How to Deactivate Baseboard Heaters on Active Circuit
There doesn't appear to be an electrical junction box in there so no, it's not safe. You will need to add junction boxes and use appropriate connectors for the cables into the boxes and then cover with cover plates. The boxes will have to remain accessible.

Or You can work backwards from here and find the connection points for these cables and disconnect the ones not being used. Hopefully the bathroom is the first heater on the circuit and at that point, you can disconnect the rest of the wires. If not, then you'll need to add junction boxes like above.