I am trying to discretize a continuous variable that does not follow a linear relationship with our response variable. I am trying to find the optimal way to discretize this variable to better capture the nonlinear relationship. The method we are using right now is to cut the variable into numerous quantiles, then conducting t-tests between each neighboring group, and combining the most like neighbors until the highest p-value is below our significance level. Is there any more efficient or accurate way to conduct this process? Many of the discretization methods I have been able to find seem to refer to a binary response.
Don't discretize at all, see Frank Harrell's explanation why this is a bad idea. If you have a nonlinear relationship, use splines instead, e.g., restricted cubic splines. Frank Harrell's textbook Regression Modeling Strategies contains a very good introduction to these.