A solution to this problem is to use the optimization formulation (that is, define the mean as the central point: the point about which one has the lowest dispersion) and redefine the difference as a modular distance (i.e., the distance on the circle: so the modular distance between 1° and 359° is 2°, not 358°).
ɐ səlˈuːʃən tə ðɪs pɹˈɑːbləm ɪz tə jˈuːz ðɪ ˌɑːptɪmᵻzˈeɪʃən fˌɔːɹmjʊlˈeɪʃən ðæt ˈɪz, dᵻfˈaɪn ðə mˈiːn æz ðə sˈɛntɹəl pˈɔɪnt: ðə pˈɔɪnt ɐbˌaʊt wˌɪtʃ wˈʌn hɐz ðə lˈoʊɪst dɪspˈɜːʒən ænd ɹˌiːdᵻfˈaɪn ðə dˈɪfɹəns æz ɐ mˈɑːdʒuːlɚ dˈɪstəns ˈaɪ.ˈiː., ðə dˈɪstəns ɔnðə sˈɜːkəl: sˌoʊ ðə mˈɑːdʒuːlɚ dˈɪstəns bᵻtwˌiːn wˈʌn dᵻɡɹˈiːz ænd θɹˈiːhˈʌndɹɪd fˈɪfti nˈaɪn dᵻɡɹˈiːz ɪz tˈuː dᵻɡɹˈiːz, nˌɑːt θɹˈiːhˈʌndɹɪd fˈɪfti ˈeɪt dᵻɡɹˈiːz.