We present a novel approach for identifying cosmic web filaments within the DisPerSE structure identification framework, using cosmic density field estimates from the Monte Carlo Physarum Machine (MCPM), inspired by the slime mold organism. We apply our method to the IllustrisTNG (TNG100) cosmological simulations and investigate the impact of filaments on galaxies. The MCPM density field is superior to the Delaunay tessellation field estimator in tracing the true underlying matter distribution and allows filaments to be identified with higher fidelity, finding more low-prominence/diffuse filaments. Using our new filament catalogs, we find that ≳90% of galaxies are located within ∼1.5 Mpc of a filamentary spine, with little change in the median star formation activity with distance to the nearest filament. Instead, we uncover a differential effect of the local filament line density, Σfil (MCPM)—the total MCPM overdensity per unit length along a filament segment—on galaxy formation: most galaxies are quenched and gas-poor near high-line density filaments at z ≤ 1. At earlier times, the filamentary environment appears to have no effect on galactic gas supply and quenching. At z = 0, quenching in log(M*/M⊙)≳10.5 galaxies is mainly driven by mass, while lower-mass galaxies are significantly affected by the filament line density. Satellites are far more susceptible to filaments than centrals. The local environments of massive halos are not sufficient to account for the effect of filament line density on gas removal and quenching. Our new approach holds great promise for observationally identifying filaments from galaxy surveys such as SDSS and DESI.