That's exactly what I have right now. ... My 2010 iMac actually does have Target Display Mode.
That's all well and good, but given that newer iMacs simply don't have that option, I was kind'a alluding to the pie-in-the-sky notion of performing such a multipurpose conversion on my 2019 iMac. That way, I could continue to use what is actually a
very nice iMac in its own right, as well as leverage that 5K screen for an alternate computer, be that an Apple Silicon system or a Windows box or whatever else I might have handy.
And honestly, I would even be hesitant to summarily gut my older 2012 iMac, as I would no longer be able to continue using those Mac internals. It may not quite meet the needs of certain modern games, but it nonetheless still performs many other tasks quite reasonably, and I would hate to give that up. For example, my father-in-law uses it daily to work from home, (Bootcamped into Windows) as he says that it's actually much faster than his two-year old Windows PC... and amusingly enough, what he
doesn't know is that the iMac he's praising just happens to also be hosting a small Minecraft server in the background, while he works.
But if I could
also use that reliable old 2012 iMac as a monitor for the even older Mini Server sitting behind it? Oh, heck yeah.