Grounded in the Job Demands-Resources (JD-R) theory, this study examines the effects of student-related classroom teaching load (job demand) and school safety mechanisms (job resource) on teacher job satisfaction, and further investigates the moderating (buffering) role of school safety mechanisms under conditions of high teaching load. Using data from the Trends in International Mathematics and Science Study (TIMSS) 2023, the analysis focuses on Grade 8 mathematics teachers in Taiwan. The findings indicate that: (1) student-related classroom teaching load entails a significant energy-depletion risk. When teachers are required to frequently respond to disruptive student behaviors, low learning interest, inattentiveness, or students with psychological, emotional, or mental health difficulties, their job satisfaction decreases significantly; (2) school safety mechanisms serve a motivational function that enhances teacher job satisfaction. When teachers perceive a safe school environment characterized by adequate safety policies and measures, clear rules governing student behavior, and fair and consistent enforcement of school rules, their job satisfaction is significantly higher; and (3) school safety mechanisms buffer the negative effect of student-related classroom teaching load on teacher job satisfaction. Their protective and buffering functions become particularly salient under conditions of high teaching load. Based on these findings, practical implications are proposed for both school administrative teams and educational authorities to strengthen the implementation of school safety mechanisms and to develop policy environments that better support schools experiencing high levels of student-related classroom teaching load.