Well, let's say you write a 10000 line program, but in that program you use 100 lines of GPL code somebody else wrote. Then you relase the binary. According to the GPL, you now have to release your entire code base under GPL, even if your plan was to keep it closed source.

Not so. Look up the definition of "derivative work" under copyright law.

A derivative work is a later work which contains in part major elements of another earlier copyrighted work.

So, your 10000 line program contains just 100 lines of an earlier work. 1%. Probably insufficient to be consider a "major element" of the earlier work.

But, even if it is considered to fall within the definition of a derived work, then ownership of the derived work is split between the authors in accordance with the level of their relative contributions. This means that the authors of the GPL code have 1% ownership in the program.

The derived work can only be distributed when all the owners reach mutual agreement on the rights to distribution. In this example, you could probably either pay the GPL authors a small amount for a commercial license to use their 100 lines, or alternatively offer to give them 1% of the profits.