Step one plug in 4K 27" monitor.
Step two set scaling factor for gtk/java apps to 2. KDE/QT apps can figure out the correct DPI without hassle.
Step three set fonts smaller or larger if desired.
On Windows plug in 4K 27" monitor. Text doesn't look in my opinion quite as nice as Linux but it isn't fuzzy, small, or giant. Possibly font rendering could look nicer if I bothered to tweak it but since its basically boot to steam I see little reason to bother.
I keep hearing this argument that 4K somehow doesn't work or looks shitty and only 5K Mac displays provide an acceptable high dpi experience and I feel like I'm getting transmissions from an alternate universe where nobody had to scale UIs from screens that varied in DPI by a factor of 3 for almost 20 years. Long before 4K screens.