Unfortunately, this patch sat forgotten in a source tree past the cutoff for new code for 4.1. Recording here so that it doesn't get forgotten again.
Created attachment 7677 [details] fold_builtin patch
Committed.