optimize hot paths of getc with manual shrink-wrapping