disable admin bar except administrator

Your third one looks like it should work, though it’s a bit hard to read. I’d recommend something like this:

add_filter( 'show_admin_bar', 'wpse424492_admin_bar', 10000 );
function wpse424492_admin_bar( $show ) {
    if ( current_user_can( 'manage_options' ) ) {
        // Show the admin bar for Admins.
        return true;
    }
    // Hide the admin bar for anyone else.
    return false;
}

I’ve added a high priority (10000) to try and have it override any other functions hooked to the filter.

tech