Am I doing something obviously wrong? Does "x.key" Go through every key in every dictionary? I don't know why "p" is changing when I press button2.
This is because dictionaries aren't a base type (like ints, floats, strings, or Vectors), and so are passed by reference, not by value. You're changing the original dictionary because pressing the first button points p to t's dictionary in memory.
Basically, imagine that for base types, a variable holds the value itself. However, for anything else, the variable is a line to a box that contains the value. You can change the value in the box much in the same way, but the distinction is important because multiple variables can be tied to the same box and thereby refer to and change the same value.
This would also be the case with other kinds of objects, like arrays or class instances. Here's a simple code example:
# Create a dictionary, and assign it to the variable dictA
var dictA = {"Test": 1}
# Create a dictionary, and assign it to the variable dictB
var dictB = {"Test": 2}
# Assign the variable dictB the dictionary in dictA
dictB = dictA
print( dictB["Test"] ) # Prints 2
See the Godot API page on references.