I had to take my mtb to a shop in New Zealand after the bearings in the rear hope hub failed. I specifically told the spanner bloke to apply copper grease to the thread when putting the cassette back on to the new freehub. Got back home to England and tried to replace the cassette. It was so tight no cranking would remove it even whilst in a vice. I knew then and there no grease had been applied.
In the end I popped off the largest aluminium ring which is pretty easy to do. The rest of the machined cogs are then free to slide off the hub. I then used a dremel tool to cut (not too deep or I’d have cut into the freehub) the remaining section of freehub (the screw on bit) to create a 1cm long but shallow slit into which I inserted a screw driver, twisted it which then forced the remaining part of the cassette to loosen it’s grip and easily screw off by hand. Desperate measures but it worked without damage to the freehub. If you do it this way it’s not overly detrimental to the freehub if you do cut into it a little bit but obviously you want to avoid this so you’ll need a very steady hand and good eye.
Prior to this I’d tried heat, freezing and loads of Plus Gas all to no avail.