Re: Check if an user is or not a group_member :
have you tried the passing user id to the bp_get_total_group_count_for_user(), do not use bp_total_group_count_for_user(), it just echoes the count.
like
`
bp_get_total_group_count_for_user($user_id);
//or if inside member loop you may o this
global $members_template;
$total_group=bp_get_total_group_count_for_user($members_template->member->id);
`
For using @djpaul ‘s method you need to know group Id. That is best suited when you are on a group page or you know exactly which groups you want to check.