Charge localization and reentrant superconductivity in a quasi-ballistic InAs nanowire coupled to superconductors