It might depend on the program, too. Some might only work in pixels. Fortunately, it is usually not a problem if you are trying to run a program designed for Gameboy; the emulator should be able to scale it automatically, subject to the user setting. I don't know if any X server has a setting to magnify mouse cursor shapes, but it seems like it should be possible to implement in the X server. Also, it seems like SDL 1.x has no environment variable to magnify the image. My own program Free Hero Mesh (which I have not worked on in a while, because I am working on other stuff) allows icons to be of any size up to 255x255 pixels (the puzzle set can contain icons of any square size up to 255x255, and may have multiple sizes; it will try to find the best size based on the user setting, using integer scaling to grow them if necessary), but currently is limited to a single built-in 8x8 font for text. If someone ports it to a library that does allow zooming, then that might help, too. However, it is not really designed for high DPI displays, and it might not be changed unless someone with a high DPI display wants to use it and modifies the program to support a user option for scaling text too (and possibly also scaling icons to a bigger size than 255x255) (then I might merge their changes, possibly).
Still, I don't need 4K. The size I have is fine, but unfortunately too many things use big text; some web pages zoom text by viewport size, which I hate, and a bigger monitor would then just make it worse.