I did keto for a few months a long time ago (2010/2011). This was early in my career and long coding and debug sessions were a normal part of my day-to-day.
There was zero impact to my work focus, positive or negative, from cutting nearly all carbohydrates out for several months.
I am curious were you heard or learned that "sugar is really important for focus". Just a vibe, perhaps?
Personal experience. Then I found many well known programmers shared the same experience online. It feels deliberate work without sugar. ie. if coding = work + fun. without sugar its just coding = work. It does not get any better after 3 days or so too.