I've also wanted something similar when writing my emacs kill ring plugin. I need to be able to maintain an integer for each distinct document. This is fine when your file is saved -- you can use view.fileName() as the identifer -- but not for unsaved files, where I can't figure out how to tell one from the other.

So if you are so inclined, Jon, how about adding a view.bufferId() method, too, which returns the same value across different views of the same buffer.