Optimization: no need to flush stdin if we can determine quickly that stdin's