This looks like it's only used for `stat`, so why not take in the argument here and call `stat` directly?

Otherwise it should probably be a generic function returning `T` and just called something along the lines of `ignore_io_errs` or something like that.