Today, you can use software like Luna or Duet, or native screen sharing to control an iMac from another Mac (or vice versa). I have a 2019 iMac, bought for pennies and upgraded after to max out; way better value than buying the display on its own or a comparable monitor alone. The screen quality is just great.
I use it both as a daily driver and as a "thin client" for all my other machines with the software above.
There is a g4 model too there if thats the version you have.
Also they require software on both sides, so if you want to use your imac to display your computer BIOS, no.
I'm still using a 2019 iMac 27" and starting to think about Linux again.
You could just run any other OS if any of the free OS upgrades that Apple provides aren’t good enough.