In a mixing bowl, combine coconut milk and 100 g of sugar. Whisk by hand until sugar has dissolved. Add eggs, whisk to combine well.
In a small saucepan, melt the remaining sugar over medium heat (the loose sugar grains will typically start to clump up as it cooks after a few minutes, before becoming a thick syrup, and then browns as it caramelises further). Once the syrup is the colour of caramel, turn off the heat. Do not over-cook as the syrup can burn and become bitter-tasting.
Then, carefully and slowly introduce the caramel syrup into the coconut milk and egg mixture, whisking as you add. Do not worry when the syrup hardens like brittle, as it mixes with the mixture. Continue to whisk, breaking down the syrup as you do so, and mixing it into the mixture (never mind the hardened bits, these will melt as the mixture cooks).
Fill a pot about one-third full with water, and bring to a gentle simmer over low heat. Place the mixing bowl over the pot, with the base of the mixing bowl above the water level. Add the knotted pandan leaves.
Gently cook the mixture, stirring regularly around the sides and bottom of the mixing bowl. Remove pandan leaves once they turn pale, and discard. Continue to cook the mixture until it thickens to desired consistency, between 45 minutes to an hour. Mixture is at ideal consistency when it thickly coats your spoon, without dripping off the edge. Add the butter (optional), and stir to mix well. Remove from heat, and set aside to cool completely to room temperature. Store in an air-tight container, and keep refrigerated. It will keep well for 1 to 2 weeks, if stored and handled well.