Short of fitting a water softener somewhere in your water supply mains, I can't think of any useful way to soften water. And, as also recommended by your (and probably our) goverment (not that I trust government one bit, but this is scientifically sound advice), softening your drinking water supply is probably not a particularly healthy choice -- you DO need those minerals in your drinking water. In that case you'd need two separate water supplies, one for household use and one for drinking. Or put a water softener on, or just before, selected taps only.
Not a reasonable solution, I would say.
What you could, at least in theory, do, is add water softeners to your shaving water. There are many chemicals to choose from (etidronic acid, pentetic acid, EDTA, to name a few), but those are generally not available to the general public. One exception would be the stuff you can buy to add to your laundry detergent to keep the heating element of your washing machine from scaling up; sold under the Calgon (ever wondered where that name came from ?) brand over here. I haven't looked closely at the ingredients, but I'm not sure I would want to put that in my shaving water.
That leaves either using bottled, boiled, or distilled water, or using a shaving soap with enough scavengers to counteract the effects of your hard water.
Note that boiling water for a few minutes deposits most of the calcium and magnesium salts in the water on the surface of the boiling vessel, making the water a lot softer too (this is why tea kettles develop scale also; this can be controlled with these wire mesh contraptions you can put in your tea kettle -- for some reason, most of the scale then deposits on this contraption rather than on the inside of the kettle.
I would recommend finding a soap with enough 'water softeners' built in, and changing to boiled (tap) water if that doesn't help.
Henk