I was not able to get this hide_pages, and show_pages functionality to work. However the purpose I tried to get this to work was because of the sidebar.
This streamlit discussion
Go inspect the source code and was able to disable the sidebar/navbar completely.
For me the data-testid is “stSidebar”
st.markdown(
"""
<style>
[data-testid="stSidebar"] {
display: none
}
</style>
""",
unsafe_allow_html=True,
)