Preheat oven to 400°F (200°C). Rub the cut sides of the spaghetti squash with 1 tablespoon olive oil and season with 1/4 teaspoon salt and a pinch of pepper.
Place squash cut-side down on a baking sheet and roast until tender, about 35–40 minutes; allow to cool slightly.
While the squash roasts, pat the shrimp dry and season with the remaining 1/4 teaspoon salt and 1/8–1/4 teaspoon pepper.
Heat 1 tablespoon oil or butter in a large skillet over medium-high heat. Sauté shrimp 1–2 minutes per side until opaque and cooked through; remove from heat.
Use a fork to scrape the roasted squash flesh into strands into a mixing bowl. Add 1/2 cup pesto and toss to coat evenly.
Toss the cooked shrimp into the pesto-coated spaghetti squash. Adjust seasoning with salt and pepper if needed, and squeeze lemon over top if using.
Serve warm, dividing among 4 plates.