The purpose of this study is to explore nonlinear and threshold effects of traffic statuses and road geometries, as well as their interactions, on traffic accident severity. In contrast to earlier research that primarily defined road alignment qualitatively as straight or curved, flat or slope, this study focused on the design elements of road geometry at accident locations. Additionally, this study considers the traffic conditions on the day of the accident, rather than the average annual traffic data as previous studies have done. To achieve this, we collected road design documents, traffic-related data, and 2023 accident data from the Suining section of the G42 Expressway in China. Using this dataset, we tested the classification performance of four machine learning models, including eXtreme Gradient Boosting, Gradient Boosted Decision Tree, Random Forest, and Light Gradient Boosting Machine. The optimal Random Forest model was employed to identify the key factors infulencing traffic accident severity, and the partial dependence plot was introduced to visualize the relationship between severity and various single and two-factor variables. The results indicate that the percentage of trucks, daily traffic volume, slope length, road grade, curvature, and curve length all exhibit significant nonlinear and threshold effects on accident severity. This reveals sepecific road and traffic features associated with varying levels of accident severity along the highway section examined in this study. The findings of this study will provide data-driven recommendations for highway design and daily safety management to reduce the severity of traffic accidents.