I hate helping the enemy in this case Jubilee. I would ordinarily demand a lot of cash upfront for this kind of advice but now that The Fatherland is in danger, I opt to give it for free.
Option -1. Find an easy Al Shabaab base, armed with embedded journalists bribed to gluttony, bomb it to smithereens. Parade the bodies for Kenyans to see and declare that it was the last remaining Al Shabaab position. Declare victory and start withdrawing. Keep a tight lid on the media so that the narrative remains yours during the withdrawal. If some disagree have ready answers like Al Shabaab is now a guerrilla movement and mesmerize the citizenry with the differences between a standing army and a guerrilla movement. Wananchi love to participate in complex military issues;
Option 2. Talk to the UN and with threats and inducements (I never saw a place with so many highly educated corrupt people in my entire life!) arrange for redeployment. That means the UN invites Kenya to send peacekeepers to some other mission - say DRC. Loudly complain that you welcome the honour but are thinly stretched. Amid publicity declare victory in Somalia and send the thieving charcoal smugglers to DRC. Request support to airlift the whole bunch and their equipment. Spend on antovs but clear them out of Somalia.
Option3. Arrange for the government of Somalia to "expel Kenyan Troops" from its territory. Unleash attack dogs like Moses Kuria and Maina Kamanda to dish it out to the Somali government. But ask senior GoK officials including Duale and Kindiki to shut up. Send Fatty Bi Omamo to announce compliance. Just an addendum: Appoint Karangi High Commissioner to Canada while he is on a trip to Europe before Fatty announces. Otherwise you face a coup from defeated and humiliated returning soldiers. (The classic solution to defeated returning soldiers was to have them killed in large enough numbers so that they posed no threat)
Option 4. The Stupid Leader's option: Withdraw the way everybody is saying. Good luck if you are still in power by the time the APCS and Tanks reach Thika!