#6214 for 7.3.x was closed without merging, but contains a cleanup of `ringbuf` and its callers. Redo this for `main`.