Improve typing of the buffering interface
- use more generic collection types, so that parametrized types can be made stricter (e.g. str, in the next revision)
- remove Optionals that are not needed and provide better defaults
Depends on !582 (closed) Related to !580 (closed)
Migrated from D4033 (view on Phabricator)