I figured out that the following code can be added to /user/index.php before line 106 ("// If they passed a role make sure they can view that role."). This will automatically add the filter "Status: Active" to the Participants page if a Teacher is viewing it.
// If this is a Teacher, add 'Active' filter by default, so that inactive students in disabled meta course links don't appear.
if ($bulkoperations and !is_siteadmin()) {
$filtersapplied[] = USER_FILTER_STATUS . ':' . ENROL_USER_ACTIVE;
}
There are hopefully more elegant solutions than this, but it does the job.