One way to do this is use GitHub - blackary/st_pages: An experimental version of Streamlit Multi-Page Apps. There is a hide_pages() function which you can see at work https://github.com/blackary/st_pages/blob/main/example_app/example_four.py
You can see the full app in action here https://st-pages.streamlit.app/