A quick Google search lead me to this little gem from a blog post by Konstantin Kovshenin:
global $wp;
$current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );
Combine that with your original code, and you have this (updated to match the WordPress coding standards):
function show_theme_switch_link_func( $atts ){
global $shown_theme, $status, $wp;
$desktop_switch_link = get_option( 'show_switch_link_for_desktop' );
$current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );
if ( $shown_theme ) {
$return = '<a rel="external" data-ajax="false" href="' . add_query_arg( 'am_force_theme_layout', 'desktop', $current_url ) . '" class="am-switch-btn godesktop">' . get_option( 'desktop_view_theme_link_text' ) . '</a>';
} else {
if ( !empty( $status ) || $desktop_switch_link == 'yes' ) {
$return = '<a href="' . add_query_arg( 'am_force_theme_layout', 'mobile', $current_url ) . '" class="am-switch-btn gomobile">' . get_option( 'mobile_view_theme_link_text' ) . '</a>';
}
}
return $return;
}