You are quite right of course.
My font drawing does in fact make use of the auto increment of the hardware by noting the new X address, so it only has to set the page/address when it crosses the 64-pixel boundary. Similarly for clearing in blocks of 8 pixels.
And you are right that filled rectangles could be optimized into the parts that fall onto 8-pixel vertical boundaries, and the edge cases. Although as you note it gets quite complex.
An interesting compromise would be to keep the library simple, but for the implementer, if they really really needed filled rectangles, and couldn't design them to fit onto 8-pixel boundaries, to combine the operations themselves. For example, do the fast fill and then do a couple of line draws to extend the rectangle vertically as required.
My only concern was that, without knowing the end application, to have a library that was quite complex, when it might not be needed. Although if the linker optimizes that out perhaps no real harm is done.
Anyway, it has been a good learning exercise - I find that if I am forced to find how the hardware works I use it more efficiently.
Now I'm curious, how well the glcd library would work sitting on top of a port expander ...
Well that would be an interesting exercise. One of the reasons I wrote my own code was because the existing libraries seemed to be heavily reliant on toggling individual pins, whereas using the port expander you had to take bit more of a "batch" approach. Plus I learnt more about port expanders. And LCD modules. And graphics.
Even without much in the way of fancy graphics I am leaning towards upgrading my mini-Adventure game to use the graphics LCD because I get 8 lines of text rather than 4. To see the earlier version:
With 8 lines of text, and maybe a mini-map in the corner, it could be quite cool. Well, as a teaching exercise if nothing else.
Just as a quick hardware question - I initially connected the backlight straight to the +5V, but then read somewhere that maybe a series resistor was warranted. Adding in a 220 ohm resistor cuts the backlight down from "quite bright" to "nice and subtle". Do you know if the backlight is intended to be directly connected to the +5V, or do they assume you put a resistor in, like you usually do for LEDs?