I’d pull the processor and ram out build a mini pc out of that, toss this conversion kit in, and then use the iMac as a display for both the upgraded arm Mac and the pc, that intel should see performance improvements in a larger more traditionally cooled case, it probably needs repasting by now anyways.
https://www.aliexpress.us/item/3256803821955158.html?gatewayAdapt=glo2usa4itemAdapt