But, thinking about it now and in terms of profiling the code over a day instead of only in request-specific isolation, it could have been a mistake for me to add it: I mean, the additional bytecode generated for testing $context['only_peeking'] and then branching is negligible, but it is present during every invocation of getTopic() (even the invocations that have nothing to do with quoting from locked threads), so depending on the ratio between ;peek requests and ordinary ones, a complete tally of time-saved vs. time-spent might not be as clear-cut as I guessed.
Maybe you could eliminate the call to getTopic altogether? Still branching as many times however the cost would likely be offset by not having the function call.
Not that it matters much, this seems such a minor issue.