Hi Adrian,
One of the main concerns with non-stationary time series is that even if two such series are completely unrelated, they can display similar trending behavior over short time horizons. This is called spurious regression and one result can be that the estimated coefficients are large and appear to be "statistically significant". This is problematic for typical inference, but also for forecasting, since there is no causal relationship between the two trending series. If they are both truly non-stationary then they will eventually diverge again, leading to poor forecasts.
However, SARIMAX does not require that your exog variables be stationary - the model will usually run with no problems with trending exog variables. As noted above, the problems occur if the model estimates a spurious relationship.
There are procedures for automatically transforming data to fit various requirements, including stationarity, and these typically fall under the description of "automatic forecasting" (for example, the pmdarima package). Usually differencing is done until the series satisfies some unit root test, such as the KPSS or Augmented Dickey–Fuller test.
Best,
Chad