Part of bzrlib
Cast it if necessary, but if the 'static_tuple' debug flag is set, raise an error instead.
As apis are improved, we will probably eventually stop calling this as it adds overhead we shouldn't need.