Depends on your circumstances doesn’t it ..no way better to dry clothes than on the line ..BUT ..enclosed small gardens aren’t great for ‘wind’ least mine isn’t and sun won’t shine in it during Winter
Plus depends on volume and yes electric/gas prices are a concern
It seems you are treating the symptom not the cause.
In my opinion, you should be looking at ways to reduce the amount of washing rather than how best to dry excessive amounts of wet garments.
I come from a background in technical problem solving so apologies if my approach seems odd to a domestic situation.