In 2.4.2, display options seem to be broken, and "1:1 pixel size", also know as square pixels, is not working.
This is the workaround using paddings that will make pixels square again via lua script. It is designed for fullscreen and will apply stretch factor as big as the screen allows.
Screen resolution can be changed in "DesktopResX" and "DesktopResY" variables, default 1920x1080.
The script needs to be launched once and then it automatically readjusts display only if the internal resolution changes. If resolution did not change since the last frame, nothing happens at all, so the performance is not impacted.