Would the shimano freewheel removal tool be roughly compatible with a Sram/shimano cassette? I have a bike with a sram Cassette and a bike with (i think) a shimano freewheel. According to https://bicycles.stackexchange.com/a/43506/38471 and other sources, in text atleast the two tools to remove them seem similar. If I were to get the smaller tool would it be reasonably compatible with both? I may need to remove the freewheel perhaps only once and I am seeing if I can use the same tool for both.

I understand that officially they need two tools. But they seem to have very similar parameters, hence the question.
The freewheel tool is of a smaller diameter to a cassette tool but the splines don’t fit the cassette lockring because the spline dimensions (width) don't match, as seen in this photo of the freewheel tool viewed through the back of a cassette lockring. The lockring is resting on the tool without engaging:

So you can’t use one tool for both, and modifying one to do so would be ineffective, I expect it would slip under torque.
Whilst it might be possible, depending on tool &amp; lockring tolerances, to hammer the freewheel tool into a cassette lockring, I wouldn't do that myself; the correct tool doesn't cost a great deal and saves damaging tools/parts.