You can try this one:
function wp_ste_add_nopin_args( $args ) {
$extra_attr="nopin="nopin"";
$args['extra_attr'] = $extra_attr;
return $args;
}
add_filter( 'get_avatar_data', 'wp_ste_add_nopin_args', 999, 1 );
For further reading, please visit: https://developer.wordpress.org/reference/functions/get_avatar_data/