The only way then would be to change the width of that margin depending on which lines are shown, which is likely to be annoying behavior when near a boundary
+1. Even when going from 9 to 10 lines or 999 to 1000 lines I find the automatic adjustment distracting, it would much more so if it happened while scrolling.
Moreover, in terse languages like Perl, I would imagine a 100,000 line file would be extremely rare (unless auto-generated or something).