I also switch on the immersion heater which I’m told costs a fortune to run.
Not as bad as I thought, the problem is, any other method needs to heat up pipes between boiler and cylinder, and with many boilers also the boiler needs heating.
As my solar panel software shows me what I am using. So I see this

as the sun comes out, first my solar panels charge my battery, but before it starts to export, it heats my cylinder, shown morning warm up. Once hot it switches off, and then while exporting we will see top up spikes where the thermostat cuts in. These are quite short, which since the immersion heater is in the cylinder, there are no losses, but if there was pipe work to heat up, as the thermostat cuts in, as well as the heat required, you're also heating a boiler and pipes.
So my immersion heater has a unit so only used excess solar, which also means it tells me how much it has used.

So even at 25p/kWh still only £8.66 at 12p/kWh loss of payment for me £4.16 a month.
My boiler uses C Plan and I have no cylinder thermostat for the boiler, only control I have is run time, and with experiments I have found 30 minutes a day is enough, this means I only heat the boiler and pipes once a day, and in real terms it stops after 20 minutes due to return water temperature, so the boiler is rated at 20 kW, it is simple on/off, so 28 x 20 x 20 / 60 = 187 kWh so using over 5 times as much energy, but the energy is around 1/5th of the cost so for me heating with oil or electric even if paying full price for electric, it works out at around the same.
However, if using a thermostat on the tank, then the boiler will likely fire up 8 times a day, so losses are higher.
My problem was, with no thermostat, how can I be sure it has got hot enough to stop legionnaires? The same applies if you use a time slot to heat the water, far better to use a thermostat to stop legionnaires, so even if using oil was slightly cheaper, for the amount saved, far better to use electric immersion heater in the summer.
Winter however is a different story, any heat in the pipes goes into the house, so not waisted energy, so using gas or oil in winter is better. This of course is reverse to summer, where hot pipes can mean the AC runs longer.
As to heat pump, I don't know. Heat pumps do not run as efficient when heating to 65°C, so there are losses in pipe work, and in the unit its self, so it is still likely cheaper to use an immersion heater, as although the heat pump is 3 times more efficient it also has losses when running for such a short time. But I have no way to measure the losses.