Change the method of a class from child function.php

In you case i am considering this is direct function attached to shortcode. You can create your own shortcode and use it to display what you want. You can try this hack hope it will help you,

add_shortcode( 'custom-bewpi-download-invoice', 'print_invoice_func');

function print_invoice_func( $atts ) {
if ( ! isset( $atts['order_id'] ) || 0 === intval( $atts['order_id'] ) ) {
return;
        }

        // by default order status should be Processing or Completed.
        $order = wc_get_order( $atts['order_id'] );
        if ( ! $order->is_paid() ) {
            return;
        }

        if ( ! BEWPI_Invoice::exists( $order->id ) ) {
            return;
        }

        $url = add_query_arg( array(
            'bewpi_action' => 'view',
            'post' => $order->id,
            'nonce' => wp_create_nonce( 'view' ),
        ) );

        $invoice = new BEWPI_Invoice( $order->id );
        $tags = array(
            '{formatted_invoice_number}' => $invoice->get_formatted_number(),
            '{order_number}'             => $order->id,
            '{formatted_invoice_date}'   => $invoice->get_formatted_invoice_date(),
            '{formatted_order_date}'     => $invoice->get_formatted_order_date(),
        );
        // find and replace placeholders.
        $title = str_replace( array_keys( $tags ), array_values( $tags ), $atts['title'] );
        // MOD OF THE PLUGIN
        thegem_button(array(
            'tag' => 'a',
            'href' => esc_attr( $url ),
            'text' => esc_html__($title, 'thegem' ),
            'style' => 'outline',
            'size' => 'medium',
            'extra_class' => 'checkout-exit',
            'attributes' => array(
            'value' => esc_attr__( $title, 'thegem' ),
            )
            ), true);
        // ORIGINAL OUTPUT
// printf( '<a href="https://wordpress.stackexchange.com/questions/261449/%1$s">%2$s</a>', esc_attr( $url ), esc_html( $title ) );
    }

paste above code in your functions.php and now use this custom shortcode

echo do_shortcode( '[custom-bewpi-download-invoice title="Download (PDF) Invoice {formatted_invoice_number}" order_id="' . $order->id . '"]' );

Let me know what output it gives to you.