What you're trying to accomplish poses a significant security risk and is generally not advised. Passing passwords via URL can expose sensitive information because URLs are logged in various places like browser history, network routers, and server logs.
However, if you're aware of these security implications and you have a valid use case for this, there is a possible solution you could consider: instead of passing the actual password in the URL, pass a uniquely generated token that maps to the password on the server side.
Here's a rough idea of how this could be done:
Generate a unique token for each password protected page. You could store these tokens in the database and associate each with the appropriate page.
When a user accesses a page via the special URL containing the token, your code intercepts the request, checks the token against the database, and if it matches, it programmatically submits the password and bypasses the password form.
If the user accesses the page via the normal URL, they would be presented with the password form as usual, since no token is being passed.
This is still not an ideal solution and would require quite a bit of custom code to implement correctly. Furthermore, it still presents a security risk as tokens could be intercepted and used by unauthorized individuals.
If you need to share access to password protected content with several users, you might want to consider using a membership plugin or a user role management plugin, which could provide a more secure way to manage access.