The annotation for db_scan_tree() says "Scan a subtree recursively and call 'callback' for each key" and that is what it seems to do, the best I can tell. Symlinks are not followed, they are passed to the callback function as symlinks.
The annotation for db_scan_tree_link() says "Similar to db_scan_tree but without following links". This is not what it seems to do, for symlinks, the callback function is called with the hkey of the symlink (returned by db_enum_link()) and the key of whatever the symlink points to (returned by db_get_key(), which follows symlinks).
There are two problems:
a) db_scan_tree_link() calls the callback function with inconsistent data - hkey of one odb entry (the symlink) and key of another entry (symlink target).
b) the annotations for the two functions are wrong or misleading: db_scan_tree() does not follow symlinks (at all), db_scan_tree_link() follows them (partially).
This confusion causes anomalies in functions like odbedit "sor" (via db_get_open_records()), see https://bitbucket.org/tmidas/midas/issues/136/odb-error-with-link-to-open-record