My understanding was that the first example should give 20 on SBCL. I tried it and it gave me 20.
On your second example, on SBCL, I got 20 for foo and 10 for bar.
* (defvar *x* 10)
*X*
* (defun foo ()
(let ((*x* 20))
(bar)))
; in: DEFUN FOO
; (BAR)
;
; caught STYLE-WARNING:
; undefined function: COMMON-LISP-USER::BAR
;
; compilation unit finished
; Undefined function:
; BAR
; caught 1 STYLE-WARNING condition
FOO
* (defun bar ()
(print *x*))
BAR
* (foo)
20
20
* (bar)
10
10
Not sure if that's helpful in any way. Is there some context we're missing?