Ironically, I've been using my iMac as an external monitor for my iPad Pro M4, to test out Stage Manager....which is a big plus for the Mac Mini and Studio - but where the iMac concept comes unstuck - you can't re-use the monitor and if you re-purpose, sell or hand down the old iMac, your keyboard and mouse probably have to go with it...
However, that is a 2010 iMac.