You probably don’t need a linear section since you can just increase the power functions to extend how long the mid-section remains linear-ish. See this desmos for a simpler form if it’s helpful: PowerP Sigmoid | Desmos
In order for that function to be useful it should be applied on a log encoded image and have a power function applied overall after, otherwise the “toe” region looks pretty wonky. (Possible you are already doing this, I have not looked closely at the code).
While I’m here and since you all seem interested in “tonescale functions”, I’ll share with you my trash pile: Google Colab