Currently these functions report errors directly to stderr, this updates
them to use diagnostics instead. This also makes partially-consumed
strings an error if the numRead parameter isn't provided (the
docstrings already claimed this happened, but it didn't.)
While here I also tried to reduce the number of overloads by switching
to using default parameters.
switched this to true since I found the parser reads past the end of the buffer if it isn't null-terminated (e.g. StringRef("999", 1) gets parsed as 999 instead of 9)