Well, I did. But it took me more time.
I’ve based mine on the Go version (although I barely know anything about that Google language):
RosettaCode.org/wiki/Sierpinski_pentagon#Go
That version uses a fixed palette of 5 primary colors.
In my sketch conversion I keep track of the current palette's index by returning it at the end of the recursive pentagon() function.
In order to get a free color fill() I’m using beginDraw() + vertex() to draw each Sierpinski pentagon.
The 1st sketch below is the Java Mode version w/ no special optimization:
2nd sketch is the p5.js version, which caches all cos() & sin() calcs inside 2 Float32Array containers, similar to what I already did before to the Python Mode conversion: