Toast the pine nuts in a large frying pan over a medium heat. Keep stirring until they have a bit of colour on all sides, which will take about 2 minutes. Remove from the pan and set aside.
Add the olive oil to the pan and heat. Add the onion and cook for about 5 minutes. Add the courgette and garlic and cook for a further minute.
Add the orzo and stir for a minute, then add the stock. Bring to the boil and then turn down to a low simmer. Cook for about 10 minutes, stirring occasionally until the orzo is cooked (it will be soft with no crunch left to it).
When the orzo is cooked, add the peas and cook for another 3 minutes until the peas are cooked. Turn the heat off, then stir in the cheese, if using. Top with the toasted pine nuts and serve.