Probably I've written it not clearly enough: "Reason for GPL not allowing you to use code in your own programs, but allowing use through exec: you either release your code and contribute to open source or suffer from slower access methods."
Judging by both the source code and its placement in the repository (gen/FreeBSD/wordexp.c), I'm thinking it's a derivative of the FreeBSD implementation (which may itself be a derivative of the NetBSD implementation, or perhaps the other way around).
- this piece of code is 2BSD-licensed
- it calls out to /bin/sh
- on OS X, /bin/sh is hardlinked to /bin/bash
- OS X's bash is GPLv2
Forking to shell is the only way to reuse bash's code. More often than not I really wish sh were not bash.