How to only show page id as body class?

Honestly, it’s source code. The only people who see it are you and other developers. Anybody casually visiting your website will never know or understand this stuff so really there’s no harm keeping it there. Buttttt… if you want to get rid of it you could filter body_class:

function custom_body_class( $classes ) {
    global $post;

    if( isset( $post ) && is_object( $post ) ) {
        $classes = array( "page-{$post->ID}" );
    }

    return $classes;
}
add_filter( 'body_class', 'custom_body_class' );