We validate the discovery of a 2-Earth-radii sub-Neptune-sized planet around the nearby high-proper-motion M2.5 dwarf G 9-40 (EPIC 212048748), using high-precision, near-infrared (NIR) radial velocity (RV) observations with the Habitable-zone Planet Finder (HPF), precision diffuser-assisted ground-based photometry with a custom narrowband photometric filter, and adaptive optics imaging. At a distance of d = 27.9 pc, G 9-40b is the second-closest transiting planet discovered by K2 to date. The planet's large transit depth (∼3500 ppm), combined with the proximity and brightness of the host star at NIR wavelengths (J = 10, K = 9.2), makes G 9-40b one of the most favorable sub-Neptune-sized planets orbiting an M dwarf for transmission spectroscopy with James Webb Space Telescope, ARIEL, and the upcoming Extremely Large Telescopes. The star is relatively inactive with a rotation period of ∼29 days determined from the K2 photometry. To estimate spectroscopic stellar parameters, we describe our implementation of an empirical spectral-matching algorithm using the high-resolution NIR HPF spectra. Using this algorithm, we obtain an effective temperature of Teff = 3404 ± 73 K and metallicity of [Fe/H] = -0.08 ± 0.13. Our RVs, when coupled with the orbital parameters derived from the transit photometry, exclude planet masses above 11.7M⊕ with 99.7% confidence assuming a circular orbit. From its radius, we predict a mass of M =5.0-1.9+3.8inf>M⊕ and an RV semiamplitude of K= 4.1-1.6+3.1 m s-1, making its mass measurable with current RV facilities. We urge further RV follow-up observations to precisely measure its mass, to enable precise transmission spectroscopic measurements in the future.