Shortcode to return an image based on post taxonomy

There’s no need to replicate The Loop in your plugin; WordPress is working within a post when it processes a shortcode, so the post ID is available when the shortcode is being processed.

Also, your arguments for has_term are out of order. And finally, it’s a best practice to make a shortcode all one word.

function fun_set_taxo_image( $atts, $content = null ) {
    global $post;

    if( has_term( 'term_name_a', 'my_taxo', $post->ID ) ) {
        return "image A";
    }
    else {
        return "image B";
    }
}

add_shortcode( 'taxoimage', 'fun_set_taxo_image' );