If you draw the drinking
water separately, into jugs say, and only treat that, then the contaminated water is safe for all other uses, even cooking, since boiling will kill the bacteria. There are any number of systems, both commercial and homemade, that will sanitize the drinking water. A
solar cooker, a glass jug set out in the sun, various chemicals including bleach, sand and charcoal filters....all of it works.
The larger issue is to try to determine how the bacteria are getting into the well. This may be because there is no pavement around the well-head, and so surface water is trickling down the outside of the pipe....this is easily solved. Other than that you have to look into how far is your well from sources like septic fields, areas where manure is piled, and such like, and try to remove or remediate these if they are nearby. Once this is done a one-time "shock treatment" of bleach poured directly into the well may solve the issue for good.