Heat the olive oil in a 3-quart / 2.8 L saucepan over medium heat. Add the chopped onion and cook for 4 to 5 minutes, until soft and translucent.
Pour in the water and raise the heat to bring it to a boil.
Lower the heat so the water simmers gently. Sprinkle in the trahana a small handful at a time, whisking constantly so it doesn't clump.
Once all the trahana is in, switch to a wooden spoon and simmer, stirring often, for 12 to 15 minutes, until the soup thickens and coats the back of the spoon like a thin porridge.
Season with the salt and pepper, then taste, keeping in mind the halloumi on top will add more salt.
Stir in the butter, if using, until melted and glossy.
Ladle the soup into bowls and top each with grated halloumi and chopped mint.
Serve right away with lemon wedges and crusty bread on the side, since the soup keeps thickening as it sits.