Preheat oven to 350°. Brush a 10-inch cast-iron skillet with butter.
In a large Dutch oven, bring squash, 6 cups water, onion, and 1 teaspoon salt to a boil over medium-high heat. Reduce heat to medium-low; simmer until almost tender, about 7 minutes. Drain.
In a large bowl, whisk together 1 cup cheese, sour cream, mayonnaise, pepper, egg, and remaining ¾ teaspoon salt. Add squash mixture and pimientos; stir well. Pour into prepared skillet. Sprinkle with remaining 1 cup cheese and crushed crackers.
Bake until mixture is bubbly and cheese is melted, about 25 minutes. Garnish with pepper, if desired.
Notes
Be careful not to boil the squash too long—you want it to hold its shape when you fold in the pimiento cheese.