Your question isn't entirely clear, but I'll try to answer it since I suspect what you're really looking for is a combination of the following.
Pseudocode is off-topic. There's multiple reasons for this, but one of them is that the code has to be actual code, from a project or anything, that's actually used or has been used. In this case, the code presented is not pseudocode. So there's no problem on that front.
The question of the OP contains the following:
Wondering if one could rewrite these 4 functions to make them more optimal.
The code presented is up for review, the goal is to optimize the functions provided and how that's actually achieved by the answers is left open. Answers in other languages are explicitly allowed by OP. That's fine, but OP doesn't decide what is and isn't an acceptable answer on Code Review.
Answers containing pseudocode have always been acceptable, as long as they're part of a review. Not on their own though. After all, we are not Stack Overflow, where answers along the lines of "Try this:
<code snippet>" appear to be acceptable.
Answers containing code in a different language are ordinarily frowned upon because they may not be of much value to whoever posted the code. We've talked about this.