if I visit for three weeks in the US and then live in Canada for 3 months then I couldn't visit the US again without having left Canada in between since this would overstay the 90-day rule
No, that’s incorrect. Only if you are still within the 90-day VWP admission period (I.e. the validity of your I-94) can that previous admission be re-used.
So if you arrive on date X, leave on X+60 and come back on X+70, you can only stay until X+89. That’s indeed to prevent actual “visa runs” where you just do a short hop across the border hoping to reset the max duration.
But if you arrive on date X, leave on X+20 and come back on X+100, your original I-94 will have expired, and you’ll get a new one.
Note that this is only one of the rules governing your stays in the US. One of the other rules is that you should not live in the US, so you can’t arrive on X, leave on X+85 and come back on X+95 hoping to stay 80 days. Even though your original I-94 will have expired, you probably won’t be granted a new one at all.
Contrary to Schengen which has a very clear 90/180 rule, there is no explicit rule about this in the US, but the rule of thumb is that you should stay out of the US as long as you stayed in.
So a 3 weeks in, 3 months out pattern should not be a problem.
3 weeks in, 2 months out should not be a problem for the second rule but can be a problem for the first one (they don’t have to readmit you on the original I-94, they can issue a new one if they feel you‘ve been out long enough, but this is really up to the CBP officer and their mood of the day, so I wouldn’t chance it).
Double check your current/last I-94 each time to make sure you’re not planning to stay across its end of validity. Also check that your exits are properly recorded.
Also beware that the word “girlfriend” can trigger additional scrutiny. Do not lie about it, but be aware that this probably requires you to have clear evidence of your intentions.