wp_get_current_user->user login returns %20 for spaces

%20 is how spaces are represented in URLs/links. It is not present in the user_login property. The browser is adding it because you’ve put in in an href attribute.

How are you creating this artist CPT? If you’re just creating it with the artist name as the title, then the slug isn’t going to necessarily be the username. It will be sanitised into a valid slug the same way post titles are normally turned into slugs. If you then try to create a link using the user login then you’re naively ignoring the process that creates the slug and expecting them to be the same.

If you want to find the post that has the title that matches the username, then you should query for a post based on the title, and then properly get its permalink:

function wppbc_current_user_link( $atts, $content ) {
    if ( ! is_user_logged_in() ) {
        return;
    }

    $current_user = wp_get_current_user();
    $user_login   = $current_user->user_login;

    $post = get_page_by_title( $user_login, 'OBJECT', 'artist' ); // Substitute 'artist' with your CPT's name.

    if ( $post ) {
        $url = esc_url( get_the_permalink( $post ) );

        return "<a href="https://wordpress.stackexchange.com/questions/339987/{$url}">Custom Page Link</a>";
    }
}

A more resilient solution, though, would be to save a reference to the post ID as user meta when the post is created. That way you don’t have to worry about post title mismatches.