First, make sure you have a reference to your game's viewport. You can access it using get_viewport(). Set an initial scale for your viewport. This can be done in the _ready() function or wherever is appropriate in your script. Create a function to change the viewport scale based on a button press. For example, if you want to toggle between the start screen size and full game size, connect this function to a button press or any other input event you prefer. For example, if you want to change the scale when the user presses a specific key. with the code:
if Input.is_action_pressed(...):
toggle_viewport_scale()