wp_list_pages(); Change output of hyperlink

You could add a filter on post_type_link, which allows modification of custom post type permalinks before they are output.

The filter passes the custom post object as the 2nd argument, so we can use that to get the ID and form the new permalink:

function wpd_list_pages_permalink_filter( $permalink, $page ){
    return '#' . $page->ID;
}

Then you can add and remove the filter when using wp_list_pages:

add_filter( 'post_type_link', 'wpd_list_pages_permalink_filter', 10, 2 );

wp_list_pages();

remove_filter( 'post_type_link', 'wpd_list_pages_permalink_filter', 10, 2 );

If your menu contained the built in page post type, you would use the page_link filter. Note in that case the 2nd argument is only the page’s ID, not the full page object like in the post_type_link filter.