bbp_setup_current_user() function is hooked to WordPress’s
set_current_user action. Internally, it only calls the
bbp_setup_current_user action, which is used by bbPress to announce itself to third party plugins looking to hook into bbPress user functionality.
This is a bit of a hack, since plugin dependencies do not exist in WordPress proper, but it’s still an excellent way to target bbPress and create plugins specifically for it.