Avoid calling to_s on the same Pathname multiple times