You could also use a Nitra-Zorb bag, look it up. That's what I used to use on my well water 20 years ago. It's 'rechargeable', it takes some time or do it's work, and you'd have to probably keep a second tank for conditioning the water to prepare for changes, but it would get rid of the nitrates.
Here's some specs from one website I fould it on:
Aquarium Pharmaceuticals Nitra-Zorb
The level of ammonia, nitrite and nitrate removed depends on the size of the Nitra-Zorb pouch, size of the aquarium, flow rate of the aquarium filter, and how much ammonia, nitrite and nitrate is being produced in the aquarium daily. A 3.7 oz (105 g) pouch of Nitra-Zorb in a 20 U.S. gallon (75.6 L) aquarium will remove 5.0 ppm ammonia, 1.0 ppm nitrite, and 20 ppm nitrate in 24-48 hours. If the aquarium is overstocked or fed heavily, the build-up of ammonia, nitrite and nitrate may occur as fast it can be removed by Nitra-Zorb. Nitrate levels may be so high that they are well above the maximum level on nitrate test kits. It may be necessary to continually recharge and reuse the Nitra-Zorb pouch until the nitrate level drops within the test kit range.
------------------
The above example is for the 3.7 oz bag. They also make a 7.4 oz bag. The big bag runs $10-11. Since your tap is at 40ppm you would need a holding tank, well-circulated that would allow enough time to allow for the bag to eliminate all the nitrates before using the water in the stocked tank. Or you could just put it directly in your stocked tank and let it work continually, but you'll have to 'recharge' it every time you do a water change and probably in between, whenever the nitrates start to climb, it's full.
Worth a try, cheaper and better than messing with RO IMO.
PS do you get green water algae blooms after water changes? That's what I used to get, I bought a Magnum and ran it with the diatom filter charged with diatomacious earth and that took out whatever was causing that.