get_available_completion_tabs is called on every page, as part of settings_navigation::initialise. This uses get_available_completion_tabs so that the bulkcompletion tab shows up if you have moodle/course:manageactivities capability in the course, or in any activity that you can see. It is implemented in a way that is very efficient if you do have that capability.
Unfortunately, most users are students who do not have that capability, so this is the common case, and this seems to be quite inefficient if you have a large course. It ends up calling $mod->uservisible && has_capability('moodle/course:manageactivities', $mod->context) for every activity in the course, and this is taking 0.29 seconds out of a 1.19 second page-load in my load testing. This is is on any page I look at in this example course containing 700 activities/resources. It is making 1400 calls to cm_info::__get (2/3 of the time) and 685 calls to has_capability (1/3 of the time).
If we coud save that much on every page-load, it would be a big win.
I have not tried, but I imagine this can be reproduced by creating a medium or large course with System administration > Development > Make test course, and then examining performace of the course page when logged in as a student.