Some shells (ksh93 and fish) do implement some optimisations there. In their $(type echo) ((type echo) in fish), they actually fake the writing of the output and the reading of it (FreeBSD sh also does it for single builtin invocations (like type here)). When a builtin's stdout is a command substitution, instead of writing the output, the shell just appends the would-be-output text to the command substitution result and there's no need for a fork.