a half-open interval is usually simpler, as here
you can avoid all the backslashes by using a couple of parentheses
delete code that does nothing
''.join is not needed here -- either way, we call .extend() with an iterable of characters
be specific about what you're guarding against
again, specific, and narrow the scope of the code guarded
add my analysis
The invariant was wrong: it does get up to BUFF_LENGTH. (See the program output.)
slightly simpler expression