On top of that, I find it easier to go into water fasting if I've been in ketosis for a bit, which is difficult in itself.
But for that, I've found it helpful to remove other dietary restrictions; I don't typically eat dairy, and the stuff I do like to eat in keto is often much more expensive than the beans and rice / peanuts/ fruit that are the staples of my diet when I'm not trying to force ketosis or fast. Eating nicer food (usually meats, lots of eggs, dairy) makes being that process easier.
It came back a few weeks later, but over a few years I tried fasting again and it would go away every single time. Now I try to avoid sweets as much as I can but when old habits creep back in I just have a fast and it goes away.
I don't really fast for any reason other than knowing it will take the sweet tooth away—and generally make me want to eat healthier.
After ingesting nothing but water, coffee and electrolytes for 3-5 days your eating compulsions will be immediately reset. It's incredible how quick the effect is when you go extreme. It's not magic but it is pretty close.