There's already software that can definitely mitigate these problems you've outlined. I've been using AndroidAPS together with Lyumjev insulin, an insulin pump and a Dexcom system for several years now. Yes, I can go running with an empty stomach and yes, I can have a nice dinner without being in the high 400's... My glucose hasn't really been above 200 for months, and the last time was a leaking tube in the pump. My A1c has been between 5.5 and 5.9% for many years now. There's no need for ambulance to come and rescue me due to hypoglycemia.
If you're in any way technical, you should take a look into the solutions for artificial pancreas.